Browse Source

Setup node route and controller

pm2
Luke Childs 8 years ago
parent
commit
56abd07939
  1. 3
      controllers/index.js
  2. 3
      controllers/node.js
  3. 1
      index.js

3
controllers/index.js

@ -1,3 +1,4 @@
module.exports = {
listing: require('./listing')
listing: require('./listing'),
node: require('./node')
};

3
controllers/node.js

@ -0,0 +1,3 @@
module.exports = (req, res, next) => {
res.json(req.params);
}

1
index.js

@ -17,5 +17,6 @@ app.use((req, res, next) => {
});
app.get('/', controllers.listing);
app.get('/node/:id', controllers.node);
app.listen(port, () => console.log(`Tor Explorer listening on port ${port}`));

Loading…
Cancel
Save