rick-and-morty/stubs/api/index.js

17 lines
452 B
JavaScript
Raw Normal View History

2024-05-18 14:03:21 +03:00
const router = require("express").Router();
2024-04-06 14:16:57 +03:00
2024-05-18 14:03:21 +03:00
router.get("/landing-data", (request, response) => {
response.send(require("../json/landing-data/success.json"));
});
router.post("/login", (req, res) => {
const { username, password } = req.body;
if (username === "admin") {
response.send(require("../json/landing-data/success.json"));
} else {
response.send(require("../json/landing-data/success.json"));
}
});
2024-05-11 14:39:59 +03:00
2024-04-06 14:16:57 +03:00
module.exports = router;