multy-stub/server/routers/freetracker/landing/index.js

29 lines
491 B
JavaScript
Raw Normal View History

2025-01-18 20:28:22 +03:00
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