Skip to content

Instantly share code, notes, and snippets.

@gingeleski
Last active August 29, 2015 14: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 gingeleski/b05e07b945e1dea376c6 to your computer and use it in GitHub Desktop.
Save gingeleski/b05e07b945e1dea376c6 to your computer and use it in GitHub Desktop.
Node.js hello world.
// 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