app.js
This file
Path
examples/error/app.js
26 lines · 716 bytes · JavaScript
Last changed by
Merge branch 'refactor/dev-deps'Tj Holowaychukbefore adoption7999386
History of this fileTake it
The walk stopped after 200 commits: lines older than 0477a53 point at it.
misc refactorTj Holowaychukbefore adoption0477a53
lines 1–25why, one step back12/**3 * Module dependencies.4 */56var express = require('../../lib/express');78var app = express.createServer();910app.get('/', function(req, res){11 // Caught and passed down to the errorHandler middleware12 throw new Error('something broke!');13});1415app.get('/next', function(req, res, next){16 // We can also pass exceptions to next()17 next(new Error('oh no!'))18});1920// The errorHandler middleware in this case will dump exceptions to stderr21// as well as show the stack trace in responses, currently handles text/plain,22// text/html, and application/json responses to aid in development23app.use('/', express.errorHandler({ dump: true, stack: true }));2425app.listen(3000);Merge branch 'refactor/dev-deps'Tj Holowaychukbefore adoption7999386
line 26why, one step back26console.log('app listening on port 3000');