Which method of the http module is used to create an HTTP server in Node.js?
- http.createServer()
- http.createHTTPServer()
- http.newServer()
- http.initServer()
In Node.js, you create an HTTP server using the http.createServer() method. This method returns an instance of the HTTP server that can listen for incoming HTTP requests. The other options do not exist in the http module.
Loading...
Related Quiz
- To implement an authorization mechanism in Express.js effectively, developers often use ______ to manage user roles and permissions.
- Which of the following is a correct way to declare a function in JavaScript?
- When destructuring arrays, using the rest operator will result in a new array containing the ______ elements.
- How can you optimize the rendering performance of template engines like EJS and Pug?
- In JavaScript, the condition in an if statement is converted to a ________ value.