-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add query parameters argument to Router.prototype.url method #227
Comments
It's already available using https://github.com/koajs/koa router.get('/test', function *(next) {
var ctx = this;
console.log(ctx.query.q);
// => 'abc'
console.log(ctx.query.number);
// => 123
}); |
Thanks for the reply! Do you think the same would be possible for the this.status = 303;
this.redirect(router.url('document', doc.document) + '?revision=' + doc._id); The latter |
It's not handled What do you think about:
I will try to send a PR tonight |
Just what I was looking for. |
Hi. Are there any plans on supporting this? |
@wachunei No plans that I've seen, but a PR could be opened with some work that matches what was discussed here—seems like there would be support for it. |
PR sent, check #396 |
published at |
koa-router's
url
method supports name and parameters. In addition to this, I would like to construct a URL with query parameters, e.g.,Is it possible to use the url method for it yet? Proper escaping would be nice too.
The text was updated successfully, but these errors were encountered: