express-send-status
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Express Send Status

Express middleware for responding with a status code and optional message.

Install

$ npm install --save express-send-status

Usage

import * as express from 'express';
import sendStatus from 'express-send-status';
 
const app = express ();
 
app.use ( '/images', express.static ( path.join ( __dirname, 'images' ) ), sendStatus ( 404 ) );
app.use ( '/fonts', express.static ( path.join ( __dirname, 'fonts' ) ), sendStatus ( 404, 'Font not found.' ) );
 
app.get ( '*', ( req, res ) => {/*...*/} ); // Potentially expensive middleware that won't be called

License

MIT © Fabio Spampinato

Package Sidebar

Install

npm i express-send-status

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

5.56 kB

Total Files

8

Last publish

Collaborators

  • fabiospampinato