fugadalcontrollo/routes/index.js
2018-08-10 00:22:02 +02:00

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