mirror of https://github.com/GOSTSec/gostexplr
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
716 B
35 lines
716 B
var models = require('../models'); |
|
var express = require('express'); |
|
var router = express.Router(); |
|
|
|
/* GET home page. */ |
|
router.get('/:address', function(req, res, next) { |
|
|
|
const address = encodeURI(req.params.address); |
|
|
|
models.Address.findOne({ |
|
where: { |
|
address, |
|
}, |
|
include: { |
|
model: models.Vout, |
|
include: { |
|
model: models.Transaction, |
|
}, |
|
}, |
|
}) |
|
.then((address) => { |
|
if (address === null) { |
|
res.status(404).render('404'); |
|
return; |
|
} |
|
const txes = []; |
|
address.Vouts.forEach((vout) => txes.push(vout.Transaction.txid)); |
|
res.render('address', { |
|
address: address.address, |
|
txes, |
|
}); |
|
}); |
|
}); |
|
|
|
module.exports = router;
|
|
|