For people like who hate typing res.status().json()
res.status().json() becomes => sender(status, json)
const express = require('express')
const app = express()
const sender = require('@sloang/express-json-sender')
app.post(sender(200, {test: 'test'}))
outputs
{"test": "test"}
let sender = require('@sloang/express-json-sender')
sender(status)
This method will call res.status with status provided, send a empty json response, and call next
sender(status, obj)
This method will call res.status, res.json and next
With npm installed, run
$ npm install @sloang/express-json-sender
MIT