Skip to content
Myr

app.js

This file

Path

examples/jade/app.js

43 lines · 947 bytes · JavaScript

Last changed by

Updated examples to use express.<middleware>Tj Holowaychukbefore adoption90a1a2f

History of this file

Take it

The walk stopped after 200 commits: lines older than 51611ec point at it.

Added test for multiple app.error() callsTj Holowaychukbefore adoption51611ec

lines 1–5why, one step back
1
2/**3 * Module dependencies.4 */5

Updated examples to use express.<middleware>Tj Holowaychukbefore adoption90a1a2f

line 6why, one step back
6var express = require('./../../lib/express');

Added test for multiple app.error() callsTj Holowaychukbefore adoption51611ec

lines 7–15why, one step back
7
8// Path to our public directory910var pub = __dirname + '/public';1112// Auto-compile sass to css with "compiler"13// and then serve with connect's staticProvider1415var app = express.createServer(

Updated examples to use express.<middleware>Tj Holowaychukbefore adoption90a1a2f

lines 16–17why, one step back
16 express.compiler({ src: pub, enable: ['sass'] }),
17 express.staticProvider(pub)

Added test for multiple app.error() callsTj Holowaychukbefore adoption51611ec

lines 18–23why, one step back
18);
1920// Optional since express defaults to CWD/views2122app.set('views', __dirname + '/views');23

Added "view engine" setting to jade exampleTj Holowaychukbefore adoption98737f1

lines 24–26why, one step back
24// Set our default template engine to "jade"
25// which prevents the need for extensions (although you can still mix and match)26app.set('view engine', 'jade');

Added test for multiple app.error() callsTj Holowaychukbefore adoption51611ec

lines 27–35why, one step back
27
28// Dummy users29var users = [30 { name: 'tj', email: 'tj@sencha.com' },31 { name: 'ciaran', email: 'ciaranj@gmail.com' },32 { name: 'aaron', email: 'aaron.heckmann+github@gmail.com' }33];3435app.get('/', function(req, res){

Added "view engine" setting to jade exampleTj Holowaychukbefore adoption98737f1

line 36why, one step back
36 res.render('users', {

Added test for multiple app.error() callsTj Holowaychukbefore adoption51611ec

lines 37–43why, one step back
37 locals: {
38 users: users39 }40 });41});4243app.listen(3000);