post /login stub example

This commit is contained in:
Primakov Alexandr Alexandrovich 2024-05-18 14:03:21 +03:00
parent eac5118aca
commit 0f3ddfb9f5

View File

@ -1,7 +1,16 @@
const router = require('express').Router(); const router = require("express").Router();
router.get('/landing-data', (request, response) => { router.get("/landing-data", (request, response) => {
response.send(require('../json/landing-data/success.json')) 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"));
}
});
module.exports = router; module.exports = router;