Answer the question
In order to leave comments, you need to log in
Is the application designed correctly on node.js + jade + react?
Greetings.
I plan to develop an application consisting of:
- templates that will be written in jade,
- components that will interact with different APIs via AJAX - on react (they will be embedded into the page after rendering the main part of the page, so that part of the content is given to the user immediately)
- node.js + express server script that runs it all.
Question:
1. You need to render jade templates "on the fly" at the request of the client, i.e.:
app..set('viewEngine', 'jade');
app.get('/',function (req, res) {
res.render('pages/landing', {locals:{'text':'demo'}} );
});
Answer the question
In order to leave comments, you need to log in
Why is jade here if React can render on the server as well ( React.renderToString and React.renderToStaticMarkup )?
consider giving the static to nginx, and let node give json only, authorization will be needed - screw it on the token.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question