Browse files

store in redis hash

  • Loading branch information...
1 parent dad1ce2 commit ea764452ac3b626de523db623f964a75a373a5da @tj tj committed Dec 18, 2011
Showing with 9 additions and 0 deletions.
  1. +2 −0 app.js
  2. +7 −0 routes/index.js
View
2 app.js
@@ -4,11 +4,13 @@
*/
var express = require('../express')
+ , redis = require('redis')
, http = require('http');
app = express();
app.configure(function(){
+ app.db = redis.createClient();
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.set('phantom', 'phantomjs');
View
7 routes/index.js
@@ -36,6 +36,13 @@ app.get('/', function(req, res){
});
});
+app.on('screenshot', function(path, hash){
+ app.db.hmset('screenshot:' + hash, {
+ path: path,
+ hash: hash
+ });
+});
+
/**
* MD5 the given `str`.
*/

0 comments on commit ea76445

Please sign in to comment.