Skip to content
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

HTTP/2 #5061

Closed
khteh opened this issue Dec 10, 2022 · 1 comment
Closed

HTTP/2 #5061

khteh opened this issue Dec 10, 2022 · 1 comment

Comments

@khteh
Copy link

khteh commented Dec 10, 2022

Does it support HTTP/2 now? If not, when?

const server = http2.createSecureServer({
  key: fs.readFileSync('server.key'),
  cert: fs.readFileSync('server.crt')
}, app);
error TS2345: Argument of type 'Express' is not assignable to parameter of type '(request: Http2ServerRequest, response: Http2ServerResponse) => void'.
  Types of parameters 'req' and 'request' are incompatible.
    Type 'Http2ServerRequest' is not assignable to type 'IncomingMessage | Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>'.
      Type 'Http2ServerRequest' is missing the following properties from type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>': get, header, accepts, acceptsCharsets, and 26 more.

18 }, app);
@dougwilson
Copy link
Contributor

Hello, and sorry for your issue. The TypeScript definitions are not kept in this repository, instead they are maintained at the https://github.com/DefinitelyTyped/DefinitelyTyped project. If you are having an error with typings, you'll need to open an issue or make a pull request there for the express typings.

As for using it with express, it is possible, though there are still issues with the Node.js compatibility API you may run in to. The Node.js project has a list of them at nodejs/node#29829 . I hope this helps!

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

No branches or pull requests

2 participants