multy-stub/server/routers/old/r-and-m/index.js

18 lines
427 B
JavaScript
Raw Normal View History

2024-05-18 13:40:25 +03:00
const router = require('express').Router();
router.get('/landing-data', (request, response) => {
2024-05-18 15:31:34 +03:00
response.send(require('./json/landing-data/success.json'));
});
router.post('/search', (req, res) => {
const { search } = req.body;
if (search === 'Morty') {
return res.send(require('./json/seach/alive.success.json'));
}
res.send(require('./json/seach/success.json'));
2024-05-18 13:40:25 +03:00
})
module.exports = router;