Skip to content
Myr

app.js

This file

Path

examples/mounting/app.js

27 lines · 656 bytes · JavaScript

Last changed by

Not known.

History of this file

Take it

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

Add haml back in docsTj Holowaychukbefore adoptione85752c

lines 1–27why, 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')10 , blog = require('../blog/app');1112var app = express.createServer();1314app.use(express.cookieParser());15app.use(express.session({ secret: 'keyboard cat' }));1617// 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.20app.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');