diff options
| author | Adam Soltys <[email protected]> | 2012-11-29 04:21:30 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2012-11-29 04:21:37 -0800 |
| commit | fe4f809298e63734e450dadb045b5af6405538b4 (patch) | |
| tree | 0178c964fa1792fdecf9603cca5159eb80a1304b /app.coffee | |
| parent | cf810110ec5f8f1387619b9f8c6a35d7f7dcce61 (diff) | |
| download | coinos-server-fe4f809298e63734e450dadb045b5af6405538b4.tar.gz coinos-server-fe4f809298e63734e450dadb045b5af6405538b4.zip | |
Post exchange rates
Diffstat (limited to 'app.coffee')
| -rw-r--r-- | app.coffee | 22 |
1 files changed, 13 insertions, 9 deletions
@@ -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¤cy=true' + path: "/t/depthcalc.json?symbol=#{req.query.symbol}&type=#{req.query.type}&amount=#{req.query.amount}¤cy=true" require('http').get(options, (r) -> r.setEncoding('utf-8') |
