I need to send an html and some variables. I think i can't use locals or res.render since it's not a view, each client can have different pages. The pages are stored in MongoDB (the html with the variables i need to send), so when they ask for the html i should send it all together.
Any ideas?
Thanks in advance.
You should separate the variables from the html. No need to save html in the database. What you need is a templating engine. If you use express, you can use "Jade" or "Handlebars". I like Handlebars because it looks more like HTML.. https://www.npmjs.org/package/express3-handlebars
Maybe you can get the value of the html as a String and then make some regex to change values. Anyways I think too its better a template engine like Jade.