Pretty Response
Express middleware that exposes functions to work with HTTP status codes
Pretty Response exposes all HTTP codes as functions on response as a middleware. So you can plug it wherever you want to and have a more expressive code than using standard response.status(CODE)
.
Install
$ npm install --save-dev pretty-response
Usage
var express = var pretty = var app =
Or you can use specifically on the routes you want to.
Then you can use descriptive names as functions to create RFC 2616 specific response:
app
All functions are using camel-cased names. For instance notFound
, internalServerError
and created
. It's easier if you take a look at the the codes file.
License
MIT