2014-01-06 08:33:58 -08:00
|
|
|
'use strict';
|
|
|
|
|
2014-01-19 05:09:59 -08:00
|
|
|
module.exports = function(app, historicSync) {
|
2014-01-06 08:33:58 -08:00
|
|
|
|
2014-01-06 09:37:32 -08:00
|
|
|
//Home route
|
|
|
|
var index = require('../app/controllers/index');
|
2014-01-23 12:02:06 -08:00
|
|
|
|
2014-01-06 09:37:32 -08:00
|
|
|
app.get('/', index.render);
|
2014-01-23 12:02:06 -08:00
|
|
|
app.get('/blocks', index.render);
|
|
|
|
app.get('/blocks-date/*', index.render);
|
|
|
|
app.get('/block/*', index.render);
|
|
|
|
app.get('/tx/*', index.render);
|
|
|
|
app.get('/address/*', index.render);
|
|
|
|
|
2014-01-22 13:13:43 -08:00
|
|
|
app.get('/api/version', index.version);
|
2014-01-06 08:33:58 -08:00
|
|
|
|
2014-01-06 14:02:33 -08:00
|
|
|
//Block routes
|
2014-01-07 04:48:31 -08:00
|
|
|
var blocks = require('../app/controllers/blocks');
|
2014-01-08 06:55:24 -08:00
|
|
|
app.get('/api/blocks', blocks.list);
|
2014-01-09 12:30:29 -08:00
|
|
|
|
|
|
|
|
2014-01-08 08:13:50 -08:00
|
|
|
app.get('/api/block/:blockHash', blocks.show);
|
2014-01-07 04:48:31 -08:00
|
|
|
app.param('blockHash', blocks.block);
|
2014-01-09 12:30:29 -08:00
|
|
|
|
2014-01-20 13:52:28 -08:00
|
|
|
app.get('/api/block-index/:height', blocks.blockindex);
|
|
|
|
app.param('height', blocks.blockindex);
|
|
|
|
|
2014-01-14 15:34:01 -08:00
|
|
|
// Transaction routes
|
2014-01-07 20:47:20 -08:00
|
|
|
var transactions = require('../app/controllers/transactions');
|
2014-01-09 10:13:26 -08:00
|
|
|
app.get('/api/tx/:txid', transactions.show);
|
2014-01-07 20:47:20 -08:00
|
|
|
app.param('txid', transactions.transaction);
|
2014-01-15 07:39:45 -08:00
|
|
|
app.get('/api/txs', transactions.list);
|
2014-01-14 15:34:01 -08:00
|
|
|
|
2014-01-15 05:22:07 -08:00
|
|
|
// Address routes
|
2014-01-13 12:21:42 -08:00
|
|
|
var addresses = require('../app/controllers/addresses');
|
|
|
|
app.get('/api/addr/:addr', addresses.show);
|
|
|
|
app.param('addr', addresses.address);
|
|
|
|
|
2014-01-16 05:54:21 -08:00
|
|
|
// Status route
|
|
|
|
var st = require('../app/controllers/status');
|
|
|
|
app.get('/api/status', st.show);
|
|
|
|
|
2014-01-19 05:09:59 -08:00
|
|
|
app.get('/api/sync', st.sync);
|
2014-01-23 12:02:06 -08:00
|
|
|
|
2014-01-06 08:33:58 -08:00
|
|
|
};
|