in express3.x, the api talks about app.render(‘view’, data, callback);
it is supposed to do the same thing as res.render, but with a callback with the rendered data, instead of sending it as a response.
Is there a way to use app.render in a route file. It’s not possible since there is no app variable anywhere but app.js
maybe there is some other easy way to just render a template and store it a variable.
I need it to send html emails.
I’m using hogan.js templates in my app.
Thanks
You can write routes and modules in a way that app gets passed when you require
and require it accordingly and pass on the app variable in app.js
This might not be a standard way, and especially the way the route file is written might be awkward. But it makes app avail. to your routes.