Hello.
How to render from string?
index.js
res.render('index', {"hello": "world"});
index.ejs
<%- hello %>
We need so:
var hello = '<%- hello %>';
res.render(hello, {"hello": "world"});
It's possible?
Depending on the case, typically you would just use the engine directly. For example:
var hello = '<%- hello %>';
res.send(ejs.render(hello, {"hello": "world"}));
@dougwilson This is exactly what I need. Thank you.
No problem :)
Most helpful comment
Depending on the case, typically you would just use the engine directly. For example: