not-found

1.0.1 • Public • Published

not-found

Express/Connect middleware to serve a default not found/404 page.

Install

npm install not-found --save

Usage

Local file

var express = require('express');
var notFound = require('not-found');
 
var app = express();
 
app.use(notFound(__dirname + '/not-found.html'));
 
app.listen(3000, function () {
 
});

Remote file

var express = require('express');
var notFound = require('not-found');
 
var app = express();
 
app.use(notFound('http://domain.com/not-found.html'));
 
app.listen(3000, function () {
 
});

notFound(file)

  • file - the path to the local file or a url for a remote file. This is required. It will skip the middleware if it is not provided or the file does not exists

Run Tests

npm install
npm test

Package Sidebar

Install

npm i not-found

Weekly Downloads

20

Version

1.0.1

License

MIT

Last publish

Collaborators

  • scottcorgan
  • mbleigh