multy-stub/server/routers/dhs-testing/index.js

36 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-05-30 17:39:33 +03:00
const { response } = require('express');
const router = require('express').Router();
router.get('/tests-data', (request, response) => {
2024-05-30 18:29:26 +03:00
response.send(require('./json/tests-data/success.json'))
2024-05-30 17:39:33 +03:00
})
router.get("/users-data", (request, response) => {
2024-05-30 18:29:26 +03:00
response.send(require("./json/users-data/success.json"))
2024-05-30 17:39:33 +03:00
})
router.get('/results-data', (request, response) => {
2024-05-30 18:29:26 +03:00
response.send(require('./json/results-data/results.json'))
2024-05-30 17:39:33 +03:00
})
router.get('/records-data', (request, response) => {
2024-05-30 18:29:26 +03:00
response.send(require('./json/records-data/records.json'))
2024-05-30 17:39:33 +03:00
})
router.post('/submit-enter', (request, response) => {
const data = request.body;
response.send({ success: true, message: "Вы успешно вошли в аккаунт!" });
});
router.post('/submit-reg', (request, response) => {
const data = request.body;
response.send({ success: true, message: "Регистрация прошла успешно!" });
});
router.post('/submit-record', (request, response) => {
const formData = request.body;
response.send({ success: true, message: "Record submitted successfully" });
});
module.exports = router;