Skip to content
Myr

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 file

Take 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 back
1/**
2 * Module dependencies.3 */4

Updated mounting example with acceptance test.Robert Sköldbefore adoptiona819856

line 5why, one step back
5var express = require('../../')

Added app.render() local precedence testTj Holowaychukbefore adoptionf98c112

lines 6–7why, one step back
6 , blog = require('../blog/app');
7

Updated mounting example with acceptance test.Robert Sköldbefore adoptiona819856

line 8why, one step back
8var app = module.exports = express();

Added app.render() local precedence testTj Holowaychukbefore adoptionf98c112

line 9why, one step back
9

Updated mounting example with acceptance test.Robert Sköldbefore adoptiona819856

lines 10–11why, one step back
10app.use(express.cookieParser('keyboard cat'));
11app.use(express.session());

Added app.render() local precedence testTj Holowaychukbefore adoptionf98c112

lines 12–19why, one step back
12
13// 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 back
20})

Added app.render() local precedence testTj Holowaychukbefore adoptionf98c112

line 21why, one step back
21

Updated mounting example with acceptance test.Robert Sköldbefore adoptiona819856

lines 22–25why, one step back
22if (!module.parent) {
23 app.listen(3000);24 console.log('Express started on port 3000');25}