Easy way to build responses.
npm i --save koa-server-response
const Koa = require('koa');
const app = new Koa();
const ServerResponse = require('koa-server-response')
app.use(async ctx => {
ServerResponse.success(ctx)
});
app.listen(3000);
Response will look like:
STATUS: 200 OK
{
"message": "OK",
"createdAt": "2019-03-30T19:54:28.117Z"
}
npm run lint
npm run test
Contributions will be highly appreciated.
Feel free to open any issues on any related matter.
Code released under the MIT.