Skip to content
Myr

app.js

This file

Path

examples/ejs/app.js

29 lines · 649 bytes · JavaScript

Last changed by

Merge branch 'view-index'Tj Holowaychukbefore adoptiona290134

History of this file

Take it

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

Settings docsTj Holowaychukbefore adoptione562adc

lines 1–18why, one step back
1
2// Expose modules in ./support for demo purposes3require.paths.unshift(__dirname + '/../../support');45/**6 * Module dependencies.7 */89var express = require('./../../lib/express');1011var app = express.createServer();1213// Optional since express defaults to CWD/views1415app.set('views', __dirname + '/views');1617// Dummy users18var users = [

fixed ejs example for new localsTj Holowaychukbefore adoption3968375

lines 19–21why, one step back
19 { name: 'tj', email: 'tj@sencha.com' }
20 , { name: 'ciaran', email: 'ciaranj@gmail.com' }21 , { name: 'aaron', email: 'aaron.heckmann+github@gmail.com' }

Settings docsTj Holowaychukbefore adoptione562adc

lines 22–24why, one step back
22];
2324app.get('/', function(req, res){

Merge branch 'view-index'Tj Holowaychukbefore adoptiona290134

line 25why, one step back
25 res.render('users.ejs', { users: users });

Settings docsTj Holowaychukbefore adoptione562adc

lines 26–28why, one step back
26});
2728app.listen(3000);

fixed ejs example for new localsTj Holowaychukbefore adoption3968375

line 29why, one step back
29console.log('Express app started on port 3000');