-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Unable to extend the app's context in Koa@2 #652
Comments
Hi, The host property on the context is the host of the request object. not the host of your running server instance. if you want to change your host:port you have to change it on the http listen function. |
It was just as an example that I picked the host port here. My bad. But any other parameters throws an error when trying to set something to context. |
Object.defineProperty(app.context, 'host', {
get: function() {
return '0.0.0.0'
},
}); |
would es6 classes even solve this issue? |
I don't think so, as delegate is still used for Request and Response. |
added docs here: e61d545 make a PR if you have any suggestions! |
for(var i=0;i<100;i++){ |
6666666 |
Trying to extend the context of the application since migrating to koa@2 throws this error:
A small example code
The text was updated successfully, but these errors were encountered: