Skip to content
This repository was archived by the owner on Jun 5, 2024. It is now read-only.

A simple Express middleware library, that hooks onto the res parameter. It helps by abstracting simple HTTP status code into simple JSON responses easily invokable.

License

Notifications You must be signed in to change notification settings

Someniak/express-http-status-codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is express-http-status-codes?

A simple Express middleware library, that hooks onto the res parameter. It helps by abstracting simple HTTP status code into simple JSON responses easily invokable.

How to use it?

Install it via NPM

  npm install --save express-http-status-codes

Include it as middleware

  const expressHttpStatusCodes = require('express-http-status-codes');

  const app = express();
  app.use(expressHttpStatusCodes());


  # In req, res handler
  function(req, res, next){
    //Will send a 404 HTTP 
    res.sendHttp(4O4);
  }

About

A simple Express middleware library, that hooks onto the res parameter. It helps by abstracting simple HTTP status code into simple JSON responses easily invokable.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published