From fb8547875ae37f38f1718e3a94d18f02eef590da Mon Sep 17 00:00:00 2001 From: Philip Heinser Date: Thu, 15 Jan 2015 13:57:21 +0100 Subject: [PATCH] added support for query index_key --- index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index c299113..1370476 100644 --- a/index.js +++ b/index.js @@ -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 || '';