ralyodio / express-template-demo

Demo of using template engines with express.js and node.js
77 stars 20 forks source link

Add nunjucks example #1

Closed jlongster closed 11 years ago

jlongster commented 11 years ago

Hey,

You can find code for integrating it here: http://nunjucks.jlongster.com/home#Express

It basically looks like this:

var nunjucks = require('nunjucks');
var express = require('express');

var env = new nunjucks.Environment(new nunjucks.FileSystemLoader('views'));
env.express(app);

You pass the path of your templates to the FileSystemLoader. You can ignore all the app.set("views") crap and other settings.

ralyodio commented 11 years ago

not sure how this will work with current app.js layout.