Blockchain explorer
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
704 B

6 years ago
var models = require('../models');
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/:address', async function(req, res, next) {
6 years ago
const addrss = encodeURI(req.params.address);
6 years ago
const address = await models.Address.findOne({
6 years ago
where: {
address: addrss,
6 years ago
},
include: {
model: models.Vout,
include: {
model: models.Transaction,
},
},
});
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,
6 years ago
});
});
module.exports = router;