Skip to content
This repository has been 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

Open
ohabash opened this issue Jun 4, 2019 · 0 comments
Open

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

ohabash opened this issue Jun 4, 2019 · 0 comments

Comments

@ohabash
Copy link

ohabash commented Jun 4, 2019

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant