Skip to content

Instantly share code, notes, and snippets.

@pinceladasdaweb
Forked from boutell/nestedapps.js
Created April 27, 2014 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pinceladasdaweb/11334293 to your computer and use it in GitHub Desktop.
Save pinceladasdaweb/11334293 to your computer and use it in GitHub Desktop.
// HOPED-FOR BEHAVIOR: /cats says: Cats Home
// ACTUAL BEHAVIOR: /cats says: Main Wildcard
var express = require('express');
var app = express();
app.get('/', function(req, res) {
res.send('Main Home');
})
var catsApp = express();
catsApp.get('/', function(req, res) {
res.send('Cats Home');
})
app.use('/cats', catsApp);
app.get('/*', function(req, res) {
res.send('Main Wildcard');
});
app.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment