Permalink
Browse files

hash -> id

  • Loading branch information...
tj committed Dec 18, 2011
1 parent ea76445 commit 00bf3ba25b49d889906be45278f9a7859b1936f0
Showing with 10 additions and 6 deletions.
  1. +10 −6 routes/index.js
View
@@ -27,19 +27,23 @@ app.get('/', function(req, res, next){
app.get('/', function(req, res){
var url = req.query.url;
if (!url) return res.send(400);
- var hash = md5(url);
- var path = join(dir, hash + '.png');
+ var id = md5(url);
+ var path = join(dir, id + '.png');
rasterize(url, path, function(err){
if (err) return res.send(500, 'Something broke!\n');
- app.emit('screenshot', path, hash);
+ app.emit('screenshot', path, id);
res.sendfile(path);
});
});
-app.on('screenshot', function(path, hash){
- app.db.hmset('screenshot:' + hash, {
+/**
+ * Set screenshot:<id> hash.
+ */
+
+app.on('screenshot', function(path, id){
+ app.db.hmset('screenshot:' + id, {
path: path,
- hash: hash
+ id: id
});
});

0 comments on commit 00bf3ba

Please sign in to comment.