Skip to content

Instantly share code, notes, and snippets.

@fbrnc

fbrnc/counter.js

Created Jun 9, 2016
Embed
What would you like to do?
Simple hit counter with node.js and Redis
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