23 lines
383 B
JavaScript
23 lines
383 B
JavaScript
const Router = require('express').Router;
|
|
|
|
const router = Router()
|
|
|
|
const timer = (_req, _res, next) => {
|
|
setTimeout(() => next(), 500)
|
|
}
|
|
|
|
router.use(timer)
|
|
|
|
router.get(
|
|
'/active',
|
|
(req, res) =>
|
|
res.send(require(`./json/active-order-success.json`))
|
|
)
|
|
|
|
router.get(
|
|
'/history',
|
|
(req, res) =>
|
|
res.send(require(`./json/history-success.json`))
|
|
)
|
|
|
|
module.exports = router |