Request
Framework Koa.js Request
Get the request paylod on the koa.js
const Koa = require('koa');
const bodyParser = require('koa-bodyparser');
const app = new Koa();
// Use koa-bodyparser middleware
app.use(bodyParser());
// Define a route handler that logs the request payload
app.use(async (ctx, next) => {
console.log(ctx.request.body);
await next();
});
app.listen(3000);