Skip to content
Myr

docs: update examples for deprecations

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 4f5b27d · Browse files · 3 files+8 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+8 added−5 removed

  • other:+8 added−5 removed

3 files+8 added−5 removed

modified:examples/error/index.js+2 added-1 removed
modified:examples/search/index.js+2 added-2 removed
modified:examples/web-service/index.js+4 added-2 removed
91 unmodified lines
92// regular middleware.93app.use(function(err, req, res, next){94 // whatever you want here, feel free to populate95 // properties on `err` to treat it differently in here.96 res.send(err.status || 500, { error: err.message });96 res.status(err.status || 500);97 res.send({ error: err.message });98});99100// our custom JSON 404 middleware. Since it's placed last101// it will be the last middleware called, if all others102// invoke next() and do not respond.103app.use(function(req, res){104 res.status(404);103 res.send(404, { error: "Lame, can't find that" });105 res.send({ error: "Lame, can't find that" });106});107108/* istanbul ignore next */109if (!module.parent) {
3 unmodified lines