diff options
| author | metoro <[email protected]> | 2013-10-03 14:55:54 -0700 |
|---|---|---|
| committer | metoro <[email protected]> | 2013-10-03 14:55:54 -0700 |
| commit | dd1313f68b14b2dbba28ade07ca5e45ca678fc1f (patch) | |
| tree | 28f0ddfb8c5296b51f301c6c1f32be161d2a2f10 | |
| parent | 676a9c336a8cda838d7350134d2781c176731e6a (diff) | |
| download | coinos-server-dd1313f68b14b2dbba28ade07ca5e45ca678fc1f.tar.gz coinos-server-dd1313f68b14b2dbba28ade07ca5e45ca678fc1f.zip | |
Do some database init
| -rw-r--r-- | app.coffee | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -62,3 +62,21 @@ app.use((err, req, res, next) -> ) app.listen(3000) + +# Setup DB +db = require("redis").createClient() +db.sismember("mts","mt:othr", (err,res) -> + if !res + db.hmset("mt:rest",{code: rest, label: "Restaurant/Bar"}, -> + db.sadd("mts","mt:rest") + ) + db.hmset("mt:coff",{code: rest, label: "Coffee Shop"}, -> + db.sadd("mts","mt:coff") + ) + db.hmset("mt:othr",{code: rest, label: "Other"}, -> + db.sadd("mts","mt:othr") + ) + console.log("Added merchant types.") +) + + |
