senecajs / seneca-web-adapter-koa2

Seneca-web adapter for koa web framework (v2)
MIT License
17 stars 4 forks source link

ctx.request.querystring to ctx.request.query sa that return a JSON #10

Closed cnxuyc closed 7 years ago

cnxuyc commented 7 years ago
if (ctx.req.method === 'POST') {
          body = await Parse(ctx)
        }

        **const query = ctx.request.querystring**

        const payload = {
          request$: ctx.request,
          response$: ctx.response,
          args: {body, query}
        }

req:http://127.0.0.1:3000/todo/edit?left=1&right=2 return:left=1&right=2

if (ctx.req.method === 'POST') {
          body = await Parse(ctx)
        }

        **const query = ctx.request.query**

        const payload = {
          request$: ctx.request,
          response$: ctx.response,
          args: {body, query}
        }

req:http://127.0.0.1:3000/todo/edit?left=1&right=2 return:{ left: '1', right: '2' }

tswaters commented 7 years ago

Good call, I'll fix that.

tswaters commented 7 years ago

This is in v1.0.5