Skip to content

Instantly share code, notes, and snippets.

@adparadise
Created November 2, 2012 20:16
Show Gist options
  • Save adparadise/4004058 to your computer and use it in GitHub Desktop.
Save adparadise/4004058 to your computer and use it in GitHub Desktop.
Basic Node WebServer
var http = require('http');
var localPort = 8090;
function server (httpRequest, httpResponse) {
httpResponse.setHeader("Content-Type", "text/html");
httpResponse.write("Hello World!");
httpResponse.end();
}
http.createServer(server).listen(localPort);
console.log("Ready for connections...");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment