multy-stub/server/routers/old/coder/catalog/index.js
Primakov Alexandr Alexandrovich 4b0d9b4dbc mongoose + tests
2024-10-16 11:06:23 +03:00

16 lines
408 B
JavaScript

// 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;