Last active
August 29, 2015 14:24
-
-
Save gingeleski/b05e07b945e1dea376c6 to your computer and use it in GitHub Desktop.
Node.js hello world.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Node.js HelloWorld | |
// Add the HTTP module - https://nodejs.org/api/http.html | |
var http = require('http'); | |
// Create a server | |
// It always expects to work with a request and response | |
var myServer = http.createServer(function(request, response) { | |
response.writeHead(200, {"Content-Type" : "text/plain"}); | |
response.end('Hello world'); | |
}); | |
myServer.listen(5000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment