const Router = require('express').Router; const router = Router() const timer = (_req, _res, next) => { setTimeout(() => next(), 500) } router.use(timer) router.get( '/trips', (req, res) => res.send(require(`./json/trips-success.json`)) ) router.get('/cars/:id', (req, res) => { res.send(require(`./json/cars-success.json`)) }) module.exports = router