I currently use Jade templates within my Node project. The setup is pretty basic:
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
I'm building a new part of my site with plain HTML and the HTML templates live in a different folder than the Jade templates.
My question is, how can I set things up so that I can also have an HTML view engine that serves files from a different directory (ie: not from views
)?
You have couple of options.
You can just put plain HTML in a .jade file and it'll work.
Or you can setup a static router to serve HTML files directly.
This way anything in your
./html-views
filder will be served statically.GET /view.html
will serve./html-views/view.html