Created
June 9, 2016 04:27
-
-
Save fbrnc/19c3ce69bbc5b4083b5a3653109f2148 to your computer and use it in GitHub Desktop.
Simple hit counter with node.js and Redis
This file contains 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 db = require("redis-client").createClient(); | |
require("http").createServer(function(request, response) { | |
db.incr("count",function(err, reply) { | |
response.writeHead(200, { "Content-Type": "text/plain" }); | |
response.write(reply.toString()); | |
response.end(); | |
}); | |
}).listen(8181); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment