Skip to content

doc: http2.createServer `options` as optional

The method might be designed to explicitly take options. However, the implementation and many examples already allow the first parameter of function type. (This is maybe because of Compatibility API.)

https://github.com/nodejs/node/blob/eeb27c2e0aecbf418635a8c4b7c4529385798c63/lib/internal/http2/core.js#L3316-L3321

// an example in doc/api/http2.md
const http2 = require('node:http2');
const server = http2.createServer();
server.on('stream', (stream, headers) => { ... });

I'm not sure whether applying the same to http2.createSecureServer is meaningful. But, seeing https.createServer, the options parameter is handled as optional.

Merge request reports

Loading