Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add app.router to static-files example

  • Loading branch information...
commit 2c174d6b3bd4cb56184bddeae15d714bb8e09c9e 1 parent 60ee465
@tj tj authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 examples/static-files/index.js
View
8 examples/static-files/index.js
@@ -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:');
Please sign in to comment.
Something went wrong with that request. Please try again.