app.js
This file
Path
examples/error/app.js
25 lines · 697 bytes · JavaScript
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 0bb7b7c point at it.
Updated connect submoduleTj Holowaychukbefore adoption0bb7b7c
lines 1–5why, one step back12/**3 * Module dependencies.4 */5Updated examples to use express.<middleware>Tj Holowaychukbefore adoption90a1a2f
line 6why, one step back6var express = require('./../../lib/express');Updated connect submoduleTj Holowaychukbefore adoption0bb7b7c
lines 7–22why, one step back78var 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 developmentUpdated examples to use express.<middleware>Tj Holowaychukbefore adoption90a1a2f
line 23why, one step back23app.use('/', express.errorHandler({ dumpExceptions: true, showStack: true }));Updated connect submoduleTj Holowaychukbefore adoption0bb7b7c
lines 24–25why, one step back2425app.listen(3000);