Closed crystalfp closed 1 week ago
FYI You could quite easily add this yourself as well by extending Koa.
class MyKoa extends Koa {
listenSecure(...args) {
return http2.createSecureServer(...)
}
}
Nice! But adding this myself does not decreases the code lines in my code. For this I proposed it as a new feature.
Describe the feature
There is a shorthand
listen(...args)
(line 86 in application.js) forhttp.createServer(app.callback()).listen(...)
but no shorthand for:http2.createSecureServer(options, app.callback()).listen(...)
Could it be added? This way will be solved also a recent typing problem created by callback() return type. Thanks!
It is not possible as the http2 is not imported into Koa and I guess http2 is not officially supported.
Submitted a PR for this here https://github.com/koajs/koa/pull/1833
Describe the feature
There is a shorthand
listen(...args)
(line 86 in application.js) forhttp.createServer(app.callback()).listen(...)
but no shorthand for:Could it be added? This way will be solved also a recent typing problem created by callback() return type. Thanks!
Checklist