Skip to content
This repository has been archived by the owner on Aug 31, 2024. It is now read-only.

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

Open
zhengyhn opened this issue Oct 25, 2016 · 0 comments
Open

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

zhengyhn opened this issue Oct 25, 2016 · 0 comments
Labels

Comments

@zhengyhn
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants