How can you implement HTTP/2 using the http module in Node.js?
- HTTP/2 is automatically implemented when you use the http module in Node.js; no special configuration is required.
- You need to enable HTTP/2 by setting the http2 option to true when creating the http server instance.
- HTTP/2 is not supported in the http module of Node.js. You need to use a third-party library for HTTP/2 support.
- HTTP/2 can only be implemented using the https module, not the http module.
To implement HTTP/2 using the http module in Node.js, you need to enable HTTP/2 by setting the http2 option to true when creating the http server instance. This will allow you to take advantage of the features provided by HTTP/2 for improved performance and efficiency.
Loading...
Related Quiz
- When building RESTful APIs with Express, the ______ object is often used to send a response back to the client.
- You notice that the application behaves differently in the development and production environments. You suspect that it is due to a difference in the package versions being used. How would you investigate and resolve this discrepancy?
- How does the switch statement compare the switch expression with the case expressions in JavaScript?
- To allow CORS for all domains, the server should set the Access-Control-Allow-Origin header to ________.
- What would be the output of using the spread operator on an object with symbol properties?