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.
29 lines
571 B
29 lines
571 B
7 years ago
|
var models = require('../models');
|
||
|
var express = require('express');
|
||
|
var router = express.Router();
|
||
|
|
||
|
/* GET home page. */
|
||
|
router.get('/:hash', function(req, res, next) {
|
||
|
const hash = encodeURI(req.params.hash);
|
||
|
models.Block.findOne({
|
||
|
where: {
|
||
|
hash,
|
||
|
},
|
||
|
include: {
|
||
|
model: models.Transaction,
|
||
|
},
|
||
|
})
|
||
|
.then((block) => {
|
||
|
if (block === null) {
|
||
|
res.status(404).render('404');
|
||
|
return;
|
||
|
}
|
||
|
block.dataValues.time = block.time.toUTCString();
|
||
|
res.render('block', {
|
||
|
block,
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
|
||
|
module.exports = router;
|