const Router = require('express').Router; const router = Router() const values = { 'blocks': 'success', 'application': 'success' } const timer = (_req, _res, next) => { setTimeout(() => next(), 500) } router.use(timer) router.get( '/blocks', (req, res) => res.send(require(`./json/blocks-${values['blocks']}.json`)) ) router.post( '/application', (req, res) => { res.send(require(`./json/application-${values['application']}.json`)) } ) module.exports = router