19 lines
402 B
JavaScript
19 lines
402 B
JavaScript
const express = require('express')
|
|
const router = express.Router()
|
|
|
|
const fromTor = require('./tor')
|
|
|
|
// 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
|