Skip to content

Instantly share code, notes, and snippets.

@StephanyBatista
Created January 11, 2016 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StephanyBatista/8f955201da6c6a252d7e to your computer and use it in GitHub Desktop.
Save StephanyBatista/8f955201da6c6a252d7e to your computer and use it in GitHub Desktop.
How create a server web
var http = require('http');
var newRequest = function(request, response) {
response.writeHead(200, {"Content-Type": "text/html"});
response.write("<h1>Hello World!</h1>");
response.end();
}
var server = http.createServer(newRequest);
var serverOn = function() {
console.log('Server is run!');
}
server.listen(3000, serverOn);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment