Skip to content

Instantly share code, notes, and snippets.

@alycda
Created July 11, 2013 18:06
Show Gist options
  • Select an option

  • Save alycda/5977738 to your computer and use it in GitHub Desktop.

Select an option

Save alycda/5977738 to your computer and use it in GitHub Desktop.
Node.JS: initialize server. #sublime
var http = require('http');
var url = require('url');
var route = function(request, response){
var path = url.parse(request.url).pathname;
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello World.\n');
};
http.createServer(route).listen(8000);
console.log('node.js Server running \'alyda\' at http://localhost:8000/');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment