0.1.1-alpha.0 • Published 5 years ago
@banterstudiosuk/http-responses v0.1.1-alpha.0
@banterstudiosuk/http-responses
Simple middleware for express to send back http responses
Install
npm
npm i --save @banterstudiosuk/http-responses
Usage
import express from 'express'
import httpResponses from '@banterstudiosuk/http-responses'
const app = express()
const router = express.Router()
app.use(httpResponses())
router.post('/', (req, res) => {
res.httpResponse.success()
})
// Catch all
app.use((err, req, res) => {
res.httpResponse.badImplementation({
error: err.stack,
message: err.message
})
})
License
MIT
0.1.1-alpha.0
5 years ago
0.1.0-alpha.0
5 years ago