diff --git a/index.js b/index.js index 1149b6d..5797404 100644 --- a/index.js +++ b/index.js @@ -1,12 +1,11 @@ const nunjucks = require('nunjucks'); const express = require('express'); +const viewModel = require('./viewModels'); const app = express(); const port = process.env.port || 3000; nunjucks.configure('views', { express: app }); -app.get('/', (req, res) => { - res.render('index.html'); -}); +app.get('/', viewModel.listing); app.listen(port, () => console.log(`Tor Explorer listening on port ${port}`)); diff --git a/viewModels/index.js b/viewModels/index.js new file mode 100644 index 0000000..b8b88d5 --- /dev/null +++ b/viewModels/index.js @@ -0,0 +1,3 @@ +module.exports = { + listing: require('./listing') +}; diff --git a/viewModels/listing.js b/viewModels/listing.js new file mode 100644 index 0000000..c0b0f83 --- /dev/null +++ b/viewModels/listing.js @@ -0,0 +1,3 @@ +module.exports = (req, res) => { + res.render('listing.html'); +} diff --git a/views/index.html b/views/listing.html similarity index 100% rename from views/index.html rename to views/listing.html