app.js
This file
Path
examples/mounting/app.js
25 lines · 558 bytes · JavaScript
Last changed by
Updated mounting example with acceptance test.Robert Sköldbefore adoptiona819856
History of this fileTake it
The walk stopped after 200 commits: lines older than f98c112 point at it.
Added app.render() local precedence testTj Holowaychukbefore adoptionf98c112
lines 1–4why, one step back1/**2 * Module dependencies.3 */4Updated mounting example with acceptance test.Robert Sköldbefore adoptiona819856
line 5why, one step back5var express = require('../../')Added app.render() local precedence testTj Holowaychukbefore adoptionf98c112
lines 6–7why, one step back6 , blog = require('../blog/app');7Updated mounting example with acceptance test.Robert Sköldbefore adoptiona819856
line 8why, one step back8var app = module.exports = express();Added app.render() local precedence testTj Holowaychukbefore adoptionf98c112
line 9why, one step back9Updated mounting example with acceptance test.Robert Sköldbefore adoptiona819856
lines 10–11why, one step back10app.use(express.cookieParser('keyboard cat'));11app.use(express.session());Added app.render() local precedence testTj Holowaychukbefore adoptionf98c112
lines 12–19why, one step back1213// mount the blog. the blog app is written using the "base"14// local variable, allowing its urls to adjust to wherever15// we wish to mount it.16app.use('/blog', blog);1718app.get('/', function(req, res){19 res.send('Visit <a href="/blog">/blog</a>');Updated mounting example with acceptance test.Robert Sköldbefore adoptiona819856
line 20why, one step back20})Added app.render() local precedence testTj Holowaychukbefore adoptionf98c112
line 21why, one step back21Updated mounting example with acceptance test.Robert Sköldbefore adoptiona819856
lines 22–25why, one step back22if (!module.parent) {23 app.listen(3000);24 console.log('Express started on port 3000');25}