Luke Childs
8 years ago
2 changed files with 18 additions and 1 deletions
@ -1,5 +1,11 @@ |
|||||
const tor = require('../lib/tor'); |
const tor = require('../lib/tor'); |
||||
|
|
||||
module.exports = (req, res, next) => { |
module.exports = (req, res, next) => { |
||||
tor.node(req.params.id).then(node => res.json(node)) |
tor.node(req.params.id) |
||||
|
.then(node => res.render('node.html', { |
||||
|
node: node, |
||||
|
})) |
||||
|
.catch(error => res.render('node.html', { |
||||
|
error: error |
||||
|
})); |
||||
} |
} |
||||
|
@ -0,0 +1,11 @@ |
|||||
|
{% extends 'index.html' %} |
||||
|
|
||||
|
{% block main %} |
||||
|
|
||||
|
{% if error %} |
||||
|
<h2>{{ 'Invalid node' if error.statusCode == 400 else error.statusMessage }}</h2> |
||||
|
{% else %} |
||||
|
<pre>{{ node | dump }}</pre> |
||||
|
{% endif %} |
||||
|
|
||||
|
{% endblock %} |
Loading…
Reference in new issue