add params to express

This commit is contained in:
Ivan Socolsky 2015-03-17 13:52:49 -03:00
parent bcd16f0f3e
commit 6c76916edb
1 changed files with 6 additions and 1 deletions

View File

@ -261,7 +261,12 @@ ExpressApp.start = function(opts) {
router.get('/v1/txhistory/', function(req, res) {
getServerWithAuth(req, res, function(server) {
server.getTxHistory({}, function(err, txs) {
var opts = {};
if (req.param['minTs']) opts.minTs = req.params['minTs'];
if (req.param['maxTs']) opts.maxTs = req.params['maxTs'];
if (req.param['limit']) opts.limit = req.params['limit'];
server.getTxHistory(opts, function(err, txs) {
if (err) return returnError(err, res, req);
res.json(txs);
res.end();