Skip to content

Commit

Permalink
added support for query index_key
Browse files Browse the repository at this point in the history
  • Loading branch information
philipheinser committed Jan 15, 2015
1 parent ebc806c commit fb85478
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ client.auth(process.env.REDIS_SECRET);

app.use(function* () {

var current = yield dbCo.get(process.env.APP_NAME +':current');
var indexkey;

if (request.query.index_key) {
indexkey = process.env.APP_NAME +':'+request.query.index_key;
} else {
indexkey = yield dbCo.get(process.env.APP_NAME +':current');
}
var index = yield dbCo.get(current);

this.body = index || '';
Expand Down

0 comments on commit fb85478

Please sign in to comment.