Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
nunjucks
const express = require('express');
const nunjucks = require('nunjucks');
const app = express();
const nunjucksConfig = {
autoescape: true,
express: app
};
/** path to templatesconfig object */
nunjucks.configure('templates', nunjucksConfig);
app.get('/', function(req, res) {
const config = {};
res.render('index.nunjucks', {
config: JSON.stringify(config),
});
});
/**
* don't cache and watch in dev
**/
nunjucksConfig = {
noCache: true,
watch: true
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.