Skip to content

Instantly share code, notes, and snippets.

@cjonagam
Created November 21, 2014 18:36
Show Gist options
  • Save cjonagam/43ffd94625b9a80a5909 to your computer and use it in GitHub Desktop.
Save cjonagam/43ffd94625b9a80a5909 to your computer and use it in GitHub Desktop.
express + redis example
var express = require('express');
var app = express();
var redis = require('redis');
var client = redis.createClient(6379,'172.20.136.159',{});
app.get('/', function (req, res) {
client.get("myname", function(err, reply) {
res.send(reply)
});
});
var server = app.listen(3000, function () {
var host = server.address().address
var port = server.address().port
console.log('Example app listening at http://%s:%s', host, port);
});
setTimeout(function(){
client.set("myname", "chakri and chakri");
},1100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment