Wondering what’s next for npm?Check out our public roadmap! »

redis-web

0.0.2 • Public • Published

redis-web

Connect middleware to proxy redis commands and pub/sub to a browser.

Example

// server
var io = require('socket.io');
var connect = require('connect');
var http = require('http');
var redisWeb = require('../')();
 
var port = 3000;
 
var app = connect()
  .use(connect.static(__dirname))
  .use(redisWeb);
 
var server = http.createServer(app).listen(port);
 
var sio = io.listen(server);
redisWeb.setSocketIo(sio);
// client
var clientCmd = redis.createClient();
clientCmd.get('mykey', function(err, data) {
  alert(data);
});
 
var clientPubSub = redis.createClient();
clientPubSub.psubscribe('*');
clientPubSub.on('pmessage', function (pattern, channel, message) {
  alert('Message: ' + channel + '' + message + '\n');
});

Keywords

none

Install

npm i redis-web

DownloadsWeekly Downloads

2

Version

0.0.2

License

none

Last publish

Collaborators

  • avatar