Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

not-found-express

uwburn33LGPL-3.01.0.2

Express middleware to return HTTP 404 - Not found when no route matches the request

readme

Not found middleware

A simple Express middleware to return HTTP 404 - Not found when no route matches the request.

Usage

var Express = require('express');
var notFoundExpress = require('not-found-express');

var express = Express();
express.use(notFoundExpress({
    message: 'Not found'
}));

Notes

The message it's optional and will default to Not found. The error generated is an http-error and can be dealt by http-error-express (see related modules).