Skip to content

Instantly share code, notes, and snippets.

@LRagji
Created February 21, 2019 11:14
Show Gist options
  • Save LRagji/f5734953e449387507868ea6d26bb1e2 to your computer and use it in GitHub Desktop.
Save LRagji/f5734953e449387507868ea6d26bb1e2 to your computer and use it in GitHub Desktop.
[Node]Pro-Tips: Use "http-errors" package to create HTTP errors
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