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.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *