app.js
This file
Path
examples/mounting/app.js
27 lines · 656 bytes · JavaScript
Last changed by
docsTj Holowaychukbefore adoption7822d1f
History of this fileTake it
Merge branch 'mounting'Tj Holowaychukbefore adoptiona572a71
lines 1–15why, one step back12// Expose modules in ./support for demo purposes3require.paths.unshift(__dirname + '/../../support');45/**6 * Module dependencies.7 */89var express = require('../../lib/express')10 , blog = require('../blog/app');1112var app = express.createServer();1314app.use(express.cookieParser());15app.use(express.session({ secret: 'keyboard cat' }));docsTj Holowaychukbefore adoption7822d1f
lines 16–19why, one step back1617// mount the blog. the blog app is written using the "base"18// local variable, allowing it's urls to adjust to wherever19// we wish to mount it.Merge branch 'mounting'Tj Holowaychukbefore adoptiona572a71
lines 20–27why, one step back20app.use('/blog', blog);2122app.get('/', function(req, res){23 res.send('Visit <a href="/blog">/blog</a>');24});2526app.listen(3000);27console.log('Server listening on port 3000');