aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormetoro <[email protected]>2013-10-03 14:55:54 -0700
committermetoro <[email protected]>2013-10-03 14:55:54 -0700
commitdd1313f68b14b2dbba28ade07ca5e45ca678fc1f (patch)
tree28f0ddfb8c5296b51f301c6c1f32be161d2a2f10
parent676a9c336a8cda838d7350134d2781c176731e6a (diff)
downloadcoinos-server-dd1313f68b14b2dbba28ade07ca5e45ca678fc1f.tar.gz
coinos-server-dd1313f68b14b2dbba28ade07ca5e45ca678fc1f.zip
Do some database init
-rw-r--r--app.coffee18
1 files changed, 18 insertions, 0 deletions
diff --git a/app.coffee b/app.coffee
index 7e285f22..366b0cc9 100644
--- a/app.coffee
+++ b/app.coffee
@@ -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.")
+)
+
+