Echo JS 0.11.0

<~>
talyssonoc 3981 days ago.
For example, if I call res.render(viewName) inside /folder/file.js, I would like that Express look for the view inside /folder/views.

If the file is inside /folder1/folder2/file.js, I would like that Express look for the view inside /folder1/folder2/views

Is it possible?

Tried to ask on StackOverflow, but nobody knew, so... I think it would be useful if somebody know how to do it!

mxxx 3980 days ago. link 1 point
off the top of my head, i'd go with:


var path = require('path');
res.render(path.join(__dirname, 'someview.hjs'))