not-found

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

MIT 17 个版本
安装
npm install not-found
yarn add not-found
pnpm add not-found
bun add not-found
README

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
版本列表
1.0.1 2014-09-17
1.0.0 2014-09-11
0.3.2 2014-09-11
0.3.1 2014-09-10
0.3.1-rc8 2014-09-10
0.3.1-rc7 2014-09-10
0.3.1-rc6 2014-09-10
0.3.1-rc5 2014-09-10
0.3.1-rc4 2014-09-10
0.3.1-rc3 2014-09-10
0.3.1-rc2 2014-09-10
0.3.1-rc1 2014-09-10
0.3.0 2014-08-29
0.2.3 2014-08-01
0.2.1 2014-07-30
0.2.0 2014-07-28
0.1.0 2014-07-22