Skip to content

Commit

Permalink
add app.router to static-files example
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Sep 3, 2012
1 parent 60ee465 commit 2c174d6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/static-files/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ app.use('/static', express.static(__dirname + '/public'));
// this will allow "GET /style.css" instead of "GET /css/style.css":
app.use(express.static(__dirname + '/public/css'));

// this examples does not have any routes, however
// you may `app.use(app.router)` before or after these
// static() middleware. If placed before them your routes
// will be matched BEFORE file serving takes place. If placed
// after as shown here then file serving is performed BEFORE
// any routes are hit:
app.use(app.router);

app.listen(3000);
console.log('listening on port 3000');
console.log('try:');
Expand Down

0 comments on commit 2c174d6

Please sign in to comment.