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

18 lines
427 B
JavaScript

const router = require('express').Router();
router.get('/landing-data', (request, response) => {
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'));
})
module.exports = router;