Skip to content

Commit

Permalink
examples: use http-errors to create errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Apr 11, 2022
1 parent ecaf67c commit b91c7ff
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions examples/params/index.js
Expand Up @@ -4,6 +4,7 @@
* Module dependencies.
*/

var createError = require('http-errors')
var express = require('../../');
var app = module.exports = express();

Expand All @@ -17,14 +18,6 @@ var users = [
, { name: 'bandit' }
];

// Create HTTP error

function createError(status, message) {
var err = new Error(message);
err.status = status;
return err;
}

// Convert :to and :from to integers

app.param(['to', 'from'], function(req, res, next, num, name){
Expand Down

0 comments on commit b91c7ff

Please sign in to comment.