2018-08-10 00:22:02 +02:00
|
|
|
const express = require('express')
|
|
|
|
const router = express.Router()
|
2018-07-21 00:55:00 +02:00
|
|
|
|
2018-08-10 00:22:02 +02:00
|
|
|
const fromTor = require('./tor')
|
2018-07-21 00:55:00 +02:00
|
|
|
|
2018-08-10 00:22:02 +02:00
|
|
|
// magic
|
|
|
|
const render = template => (req, res) => res.render(template)
|
|
|
|
|
|
|
|
router.get('/', render('index'))
|
|
|
|
|
|
|
|
// livello I
|
|
|
|
router.get('/subito', fromTor,
|
|
|
|
(req, res) => res.render(req.fromTor ? 'torok' : 'tornook') )
|
|
|
|
|
|
|
|
// livello II
|
|
|
|
router.get('/metadata', render('metadata'))
|
|
|
|
|
|
|
|
module.exports = router
|