Answer the question
In order to leave comments, you need to log in
How to render react page in mern?
Good afternoon, I'm doing backing on Node, front on react. Previously, when I didn’t use react, I simply passed the hbs page to res.render, but how now to pass the index.html page to render, which is in the frontend / public folder?
Answer the question
In order to leave comments, you need to log in
There are two options:
1 -- Google how SSR is done to render a page on the server and send a ready-made, fully built page to
res.send 2 -- Just use res.sendFile('FILENAME') and give an empty page with scripts ( just your index.html), then react will build the application already on the client. Dock res.sendFile -here
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question