Created
February 21, 2019 11:14
-
-
Save LRagji/f5734953e449387507868ea6d26bb1e2 to your computer and use it in GitHub Desktop.
[Node]Pro-Tips: Use "http-errors" package to create HTTP errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var createError = require('http-errors'); | |
var express = require('express'); | |
var app = express(); | |
app.use(function (req, res, next) { | |
next(createError(404)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment