28// Routes
29
30▶app.get('/', function(req, res){
31 res.render('index.ejs');
32});
· · ·
33
34▶app.get('/404', function(req, res, next){
35 // trigger a 404 since no other middleware
36 // will match /404 after this one, and we're not
· · ·
39});
40
41▶app.get('/403', function(req, res, next){
42 // trigger a 403 error
43 var err = new Error('not allowed!');
· · ·
46});
47
48▶app.get('/500', function(req, res, next){
49 // trigger a generic (500) error
50 next(new Error('keyboard cat!'));
· · ·
61// $ curl http://localhost:3000/notfound -H "Accept: text/plain"
62
63▶app.use(function(req, res, next){
64 res.status(404);
65
+ 6 more matches in this file