A tiny, zero dependencies Express middleware for clear and concise http response handling.
npm i -S resty
const app = require('express')();
const resty = require('resty');
app.use(resty());
app.get('/ping', (req, res) => res.success());
which will respond with the following response:
{
"message": "success",
"payload": {}
}
Property | Type | Description | Example |
---|---|---|---|
statusCodes |
Object |
set custom status code for specific http response | {redirect: 307 } |