add params to express
This commit is contained in:
parent
bcd16f0f3e
commit
6c76916edb
|
@ -261,7 +261,12 @@ ExpressApp.start = function(opts) {
|
||||||
|
|
||||||
router.get('/v1/txhistory/', function(req, res) {
|
router.get('/v1/txhistory/', function(req, res) {
|
||||||
getServerWithAuth(req, res, function(server) {
|
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);
|
if (err) return returnError(err, res, req);
|
||||||
res.json(txs);
|
res.json(txs);
|
||||||
res.end();
|
res.end();
|
||||||
|
|
Loading…
Reference in New Issue