Stelescope/node_modules/express-partials/test/fixtures/chained-views/app.js
Saturneric a7116b5291 Add
2020-09-01 00:25:01 +08:00

24 lines
481 B
JavaScript

var express = require('express')
, partials = require('../../../')
, app = module.exports = express();
app.configure(function() {
app.set('views', __dirname);
app.set('view engine', 'ejs');
app.use(function(req, res, next){
res.locals.logged_user = 'bob';
res.locals.config = {title:'partially'};
next();
})
app.use(partials())
})
app.get('/', function(req, res){
res.render('view1')
})
app.get('/locals', function(req, res){
res.render('locals1')
})