app.js
This file
Path
examples/layout-control/app.js
32 lines · 734 bytes · JavaScript
Last changed by
Removed "view options" setting. Closes #748Tj Holowaychukbefore adoption3ec2739
History of this fileTake it
The walk stopped after 200 commits: lines older than e0bc571 point at it.
auto set Content-Type in res.attachementAaron Heckmannbefore adoptione0bc571
lines 1–12why, one step back12/**3 * Module dependencies.4 */56var express = require('../../lib/express');78var app = express.createServer();910app.set('views', __dirname + '/views');1112// set default layout, usually "layout"Removed "view options" setting. Closes #748Tj Holowaychukbefore adoption3ec2739
line 13why, one step back13app.local('layout', 'layouts/default');auto set Content-Type in res.attachementAaron Heckmannbefore adoptione0bc571
line 14why, one step back14Merged pull request #645 from 8bitDesigner/patch-1.TJ Holowaychukbefore adoptionfc2bc13
line 15why, one step back15// Set our default template engine to "ejs"auto set Content-Type in res.attachementAaron Heckmannbefore adoptione0bc571
lines 16–32why, one step back16// which prevents the need for extensions17// (although you can still mix and match)18app.set('view engine', 'ejs');1920app.get('/', function(req, res){21 res.render('pages/default');22});2324app.get('/alternate', function(req, res){25 // note that we do not explicitly26 // state the layout here, the view does,27 // although we could do it here as well.28 res.render('pages/alternate');29});3031app.listen(3000);32console.log('Express app started on port 3000');