Answer the question
In order to leave comments, you need to log in
How to correctly pass urls to the template engine during server rendering?
I am developing a site based on express, without using front-end frameworks. Suddenly stalled at a fairly simple moment. Since I'm server-rendered, in order to render the page to the user, I call the res.render method, which I pass in the template and an object that contains the values for the substitutions.
The templates have placeholders for static URLs (all sorts of menu items, etc.), they look something like this:
<a href="{{ urls.auth.signup }}" class="_btnReg __btnReg">{{ static.signup }}</a>
urls: {
auth: {
signup: '/signup',
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question