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.
21 lines
620 B
21 lines
620 B
const nunjucks = require('nunjucks');
|
|
const express = require('express');
|
|
const nunjuckFilters = require('./lib/nunjuck-filters');
|
|
const viewModel = require('./viewModels');
|
|
const app = express();
|
|
const port = process.env.port || 3000;
|
|
|
|
app.set('nunjucksEnv', nunjucks.configure('views', { express: app }));
|
|
nunjuckFilters(app);
|
|
|
|
app.use((req, res, next) => {
|
|
req.app.settings.nunjucksEnv
|
|
.addGlobal('req', req)
|
|
.addGlobal('res', res);
|
|
|
|
next();
|
|
});
|
|
|
|
app.get('/', viewModel.listing);
|
|
|
|
app.listen(port, () => console.log(`Tor Explorer listening on port ${port}`));
|
|
|