Skip to content
This repository was archived by the owner on Oct 14, 2024. It is now read-only.
This repository was archived by the owner on Oct 14, 2024. It is now read-only.

serve prerendered files with an express app instead of http-server #680

@ohabash

Description

@ohabash

problem

right now prerendering is working in my universal app. I start the server like this

cd dist/browser && http-server

but now my site does not have a configurable server. Id like to host an api and the static prerendered paths with an an express server.

tried

to added this middleware to server.ts

app.get('*', function (req, res) {
    res.render(`${req.path}/index`, { req: req });
});

that works but unlike http-server there is a flicker; maybe something wrong with the transferState ?

was expecting

the express app to serve prerendered routes (node dist/server) exactly the same as http-server (cd dist/browser && http-server)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions