Luke Childs
8 years ago
4 changed files with 8 additions and 3 deletions
@ -1,12 +1,11 @@ |
|||||
const nunjucks = require('nunjucks'); |
const nunjucks = require('nunjucks'); |
||||
const express = require('express'); |
const express = require('express'); |
||||
|
const viewModel = require('./viewModels'); |
||||
const app = express(); |
const app = express(); |
||||
const port = process.env.port || 3000; |
const port = process.env.port || 3000; |
||||
|
|
||||
nunjucks.configure('views', { express: app }); |
nunjucks.configure('views', { express: app }); |
||||
|
|
||||
app.get('/', (req, res) => { |
app.get('/', viewModel.listing); |
||||
res.render('index.html'); |
|
||||
}); |
|
||||
|
|
||||
app.listen(port, () => console.log(`Tor Explorer listening on port ${port}`)); |
app.listen(port, () => console.log(`Tor Explorer listening on port ${port}`)); |
||||
|
@ -0,0 +1,3 @@ |
|||||
|
module.exports = { |
||||
|
listing: require('./listing') |
||||
|
}; |
@ -0,0 +1,3 @@ |
|||||
|
module.exports = (req, res) => { |
||||
|
res.render('listing.html'); |
||||
|
} |
Loading…
Reference in new issue