Node.js quiz · 27 questions

Create server

Read the code

The code snippet provides a valid way to create a Node server.


var http = require("http");

http.createServer(function (request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello World\n');
}).listen(8080);

console.log('Server running at port 8080');
  • 1–2 answer
  • ← previous
Question 4 of 2711%