Stelescope/node_modules/express-partials/test/fixtures/locals/app.js

21 lines
478 B
JavaScript
Raw Normal View History

2020-08-31 16:25:01 +00:00
var express = require('express')
, engines = require('consolidate')
, partials = require('../../../')
, app = module.exports = express();
app.engine('haml', engines.haml);
app.use(partials());
partials.register('.haml','hamljs');
app.use(partials());
app.set('views',__dirname)
app.use(function(req,res,next){
app.set('view engine', 'haml');
next()
})
app.get('/',function(req,res,next){
res.render('index', {favourite_number: 48, favourite_colour: "blue"})
})