multy-stub/server/routers/old/coder/catalog/index.js

16 lines
408 B
JavaScript
Raw Permalink Normal View History

2023-08-01 13:14:02 +03:00
// eslint-disable-next-line new-cap
const router = require('express').Router();
router.get('/catalog', (request, response, next) => {
setTimeout(() => next());
}, (request, response) => {
const params = process.env.stub;
if (params === 'error') {
response.send(require('./error.json'));
} else {
response.send(require('./cardData.json'));
}
});
module.exports = router;