koajs / koa.io

[MAINTAINERS WANTED] Realtime web framework combine koa and socket.io.
429 stars 52 forks source link

``this.request.query`` is empty in original koa middleware #65

Open zhengyhn opened 8 years ago

zhengyhn commented 8 years ago

Here is my code.

const koa = require('koa.io')
const app = koa()
// if I use the original 'koa', it's ok
// const app = require('koa')()

const Router = require('koa-router')
const router = new Router()
router.get('/test', function * () {
    console.log(this.query);                  // output {}
    console.log(this.request.query);     // output {}
})
app.use(router.routes())

Thanks.