Skip to content

Instantly share code, notes, and snippets.

@roblayton
Created May 27, 2015 02:43
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 roblayton/2300ae89c0f1ef6f65a0 to your computer and use it in GitHub Desktop.
Save roblayton/2300ae89c0f1ef6f65a0 to your computer and use it in GitHub Desktop.
Example nodejs app
var http = require('http');
// Http server
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
text = "Running Node.js:" + process.versions.node
response.end(text);
});
var port = process.env.PORT || 8080;
server.listen(port);
console.log("Server running at http://127.0.0.1:" + port + "/");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment