Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Create a koa server which parse the post data, Convert the name field to
- upper case and respond to client.
- If you get this:
- POST / with { name: 'koa' }
- Respond with:
- KOA
- I have this solution but this does not work :
- var koa = require('koa');
- var bodyParser = require('koa-bodyparser');
- var app = koa();
- app.use(bodyParser({
- detectJSON: function (ctx) {
- this.body = ctx.toUpperCase();
- }
- }));
- app.listen(process.argv[2]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement