aboutsummaryrefslogtreecommitdiffstats
path: root/app.coffee
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2012-11-29 04:21:30 -0800
committerAdam Soltys <[email protected]>2012-11-29 04:21:37 -0800
commitfe4f809298e63734e450dadb045b5af6405538b4 (patch)
tree0178c964fa1792fdecf9603cca5159eb80a1304b /app.coffee
parentcf810110ec5f8f1387619b9f8c6a35d7f7dcce61 (diff)
downloadcoinos-server-fe4f809298e63734e450dadb045b5af6405538b4.tar.gz
coinos-server-fe4f809298e63734e450dadb045b5af6405538b4.zip
Post exchange rates
Diffstat (limited to 'app.coffee')
-rw-r--r--app.coffee22
1 files changed, 13 insertions, 9 deletions
diff --git a/app.coffee b/app.coffee
index 75cdf310..46d3260f 100644
--- a/app.coffee
+++ b/app.coffee
@@ -37,13 +37,19 @@ app.use(passport.initialize())
app.use(passport.session())
app.use(app.router)
-for route in ['', 'about', 'exchangers', 'merchants']
- ((route) ->
- app.get("/#{route}", (req, res) ->
- route = 'index' if route == ''
- res.render(route, js: (-> global.js), css: (-> global.css), layout: 'layout')
+routes =
+ "/": 'index'
+ "/about": 'about'
+ "/exchangers": 'exchangers'
+ "/exchangers/new": 'join'
+ "/merchants": 'merchants'
+
+for route, view of routes
+ ((route, view) ->
+ app.get(route, (req, res) ->
+ res.render(view, js: (-> global.js), css: (-> global.css), layout: 'layout')
)
- )(route)
+ )(route, view)
app.get('/setup', (req, res) ->
res.render('setup', js: (-> global.js), css: (-> global.css))
@@ -86,9 +92,7 @@ app.get('/:user/transactions', (req, res) ->
app.get('/ticker', (req, res) ->
options =
host: 'bitcoincharts.com',
- path: '/t/depthcalc.json?symbol=' +
- req.query.symbol +
- '&type=ask&amount=1000&currency=true'
+ path: "/t/depthcalc.json?symbol=#{req.query.symbol}&type=#{req.query.type}&amount=#{req.query.amount}&currency=true"
require('http').get(options, (r) ->
r.setEncoding('utf-8')