Created
July 2, 2014 02:40
-
-
Save gmemstr/304e0fd4fa360f44f9f3 to your computer and use it in GitHub Desktop.
Simple node.js HTTP server
This file contains hidden or 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
var http = require("http"); | |
var unum = 0; | |
var port = 8888; | |
http.createServer(function(request, response) { | |
response.writeHead(200, {"Content-Type": "text/plain"}); | |
response.write("Hello World"); | |
unum = unum + 1; | |
console.log("Users visited: " + unum); | |
response.end(); | |
}).listen(port); | |
console.log("Server started on port " + port); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment