Skip to content
Myr

app.js

This file

Path

examples/ejs/app.js

34 lines · 741 bytes · JavaScript

Last changed by

Merge branch 'docs'Tj Holowaychukbefore adoption64da262

History of this file

Take it

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

Updated connect submoduleTj Holowaychukbefore adoptiona9db47f

lines 1–8why, one step back
1
2// Expose modules in ./support for demo purposes3require.paths.unshift(__dirname + '/../../support');45/**6 * Module dependencies.7 */8

docsTj Holowaychukbefore adoption6cae1f0

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

Updated connect submoduleTj Holowaychukbefore adoptiona9db47f

lines 10–12why, one step back
10
11var app = express.createServer();12

Merge branch 'docs'Tj Holowaychukbefore adoption64da262

lines 13–16why, one step back
13// Register ejs as .html
1415app.register('.html', require('ejs'));16

Updated connect submoduleTj Holowaychukbefore adoptiona9db47f

lines 17–19why, one step back
17// Optional since express defaults to CWD/views
1819app.set('views', __dirname + '/views');

Merge branch 'docs'Tj Holowaychukbefore adoption64da262

line 20why, one step back
20app.set('view engine', 'html');

Updated connect submoduleTj Holowaychukbefore adoptiona9db47f

lines 21–29why, one step back
21
22// Dummy users23var users = [24 { name: 'tj', email: 'tj@sencha.com' }25 , { name: 'ciaran', email: 'ciaranj@gmail.com' }26 , { name: 'aaron', email: 'aaron.heckmann+github@gmail.com' }27];2829app.get('/', function(req, res){

Merge branch 'docs'Tj Holowaychukbefore adoption64da262

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

Updated connect submoduleTj Holowaychukbefore adoptiona9db47f

lines 31–34why, one step back
31});
3233app.listen(3000);34console.log('Express app started on port 3000');