Compare commits

...

9 Commits

10 changed files with 544 additions and 27 deletions

View File

@@ -87,6 +87,8 @@ app.use("/edateam", require("./routers/edateam-legacy"))
app.use("/dry-wash", require("./routers/dry-wash")) app.use("/dry-wash", require("./routers/dry-wash"))
app.use("/freetracker", require("./routers/freetracker")) app.use("/freetracker", require("./routers/freetracker"))
app.use("/dhs-testing", require("./routers/dhs-testing")) app.use("/dhs-testing", require("./routers/dhs-testing"))
app.use("/gamehub", require("./routers/gamehub"))
app.use(require("./error")) app.use(require("./error"))

View File

@@ -1,35 +1,40 @@
const router = require('express').Router(); const router = require("express").Router();
router.get("/users", (request, response) => { router.get("/users", (request, response) => {
response.send(require("./json/users/users.json")) response.send(require("./json/users/users.json"));
}) });
router.post("/auth", (request, response) => { router.post("/auth", (request, response) => {
const {phoneNumber, password} = request.body; const { phoneNumber, password } = request.body;
console.log(phoneNumber, password); console.log(phoneNumber, password);
if (phoneNumber === '89999999999') { if (phoneNumber === "89999999999") {
response.send(require("./json/auth/dogsitter.success.json")) response.send(require("./json/auth/dogsitter.success.json"));
} } else if (phoneNumber === "89555555555") {
else if (phoneNumber === '89555555555') { response.status(400).send(require("./json/auth/error.json"));
response.status(400).send(require("./json/auth/error.json")) } else {
} response.send(require("./json/auth/owner.success.json"));
else { }
response.send(require("./json/auth/owner.success.json")) });
}
}) router.post("/auth/2fa", (request, response) => {
const { code } = request.body;
if (code === "0000") {
response.send(require("./json/2fa/success.json"));
} else {
response.status(400).send(require("./json/2fa/error.json"));
}
});
router.post("/register", (request, response) => { router.post("/register", (request, response) => {
const {firstName, secondName, phoneNumber, password, role} = request.body; const { firstName, secondName, phoneNumber, password, role } = request.body;
console.log(phoneNumber, password, role); console.log(phoneNumber, password, role);
if (phoneNumber === '89283244141' || phoneNumber === '89872855893') { if (phoneNumber === "89283244141" || phoneNumber === "89872855893") {
response.status(400).send(require("./json/register/error.json")) response.status(400).send(require("./json/register/error.json"));
} } else if (role === "dogsitter") {
else if (role === 'dogsitter') { response.send(require("./json/register/dogsitter.success.json"));
response.send(require("./json/register/dogsitter.success.json")) } else {
} response.send(require("./json/register/owner.success.json"));
else { }
response.send(require("./json/register/owner.success.json")) });
}
})
module.exports = router; module.exports = router;

View File

@@ -0,0 +1,4 @@
{
"status": "error",
"message": "Invalid code."
}

View File

@@ -0,0 +1,4 @@
{
"status": "success",
"message": "Two-factor authentication passed."
}

View File

@@ -0,0 +1,23 @@
const router = require("express").Router();
router.get("/game-page", (request, response) => {
response.send(require("./json/gamepage/success.json"));
});
router.get("/categories", (request, response) => {
response.send(require("./json/categories/success.json"));
});
router.get("/shopping-cart", (request, response) => {
response.send(require("./json/shopping-cart/success.json"));
});
router.get("/home", (request, response) => {
response.send(require("./json/home-page-data/success.json"));
});
router.get("/all-games", (request, response) => {
response.send(require("./json/home-page-data/all-games.json"));
});
module.exports = router;

View File

@@ -0,0 +1,150 @@
{
"success": true,
"data": {
"games1": [
{
"id": 1,
"title": "How to Survive",
"price": 259,
"old_price": 500,
"image": "sales_game1",
"os": "windows"
},
{
"id": 2,
"title": "Red Solstice 2 Survivors",
"price": 561,
"image": "sales_game2",
"os": "windows"
},
{
"id": 3,
"title": "Sons Of The Forests",
"price": 820,
"old_price": 1100,
"image": "new_game2",
"os": "windows"
},
{
"id": 4,
"title": "The Witcher 3: Wild Hunt",
"price": 990,
"old_price": 1200,
"image": "leaders_game4",
"os": "windows"
},
{
"id": 5,
"title": "Atomic Heart",
"price": 1200,
"old_price": 2500,
"image": "leaders_game5",
"os": "windows"
},
{
"id": 6,
"title": "Crab Game",
"price": 600,
"old_price": 890,
"image": "leaders_game6",
"os": "windows"
}
],
"games2": [
{
"id": 1,
"title": "Alpha League",
"price": 299,
"image": "new_game1",
"os": "windows"
},
{
"id": 2,
"title": "Sons Of The Forests",
"price": 820,
"old_price": 1100,
"image": "new_game2",
"os": "windows"
},
{
"id": 3,
"title": "Pacific Drives",
"price": 1799,
"image": "new_game3",
"os": "windows"
},
{
"id": 4,
"title": "The Witcher 3: Wild Hunt",
"price": 990,
"old_price": 1200,
"image": "leaders_game4",
"os": "windows"
},
{
"id": 5,
"title": "Atomic Heart",
"price": 1200,
"old_price": 2500,
"image": "leaders_game5",
"os": "windows"
},
{
"id": 6,
"title": "Crab Game",
"price": 600,
"old_price": 890,
"image": "leaders_game6",
"os": "windows"
}
],
"games3": [
{
"id": 1,
"title": "Elden Ring",
"price": 3295,
"old_price": 3599,
"image": "leaders_game2",
"os": "windows"
},
{
"id": 2,
"title": "Counter-Strike 2",
"price": 479,
"image": "leaders_game1",
"os": "windows"
},
{
"id": 3,
"title": "PUBG: BATTLEGROUNDS",
"price": 199,
"image": "leaders_game3",
"os": "windows"
},
{
"id": 4,
"title": "The Witcher 3: Wild Hunt",
"price": 990,
"old_price": 1200,
"image": "leaders_game4",
"os": "windows"
},
{
"id": 5,
"title": "Atomic Heart",
"price": 1200,
"old_price": 2500,
"image": "leaders_game5",
"os": "windows"
},
{
"id": 6,
"title": "Crab Game",
"price": 600,
"old_price": 890,
"image": "leaders_game6",
"os": "windows"
}
]
}
}

View File

@@ -0,0 +1,24 @@
{
"success": true,
"data": {
"comments": [
{
"username": ользователь1",
"text": "Текст комментария 1"
},
{
"username": ользователь2",
"text": "Текст комментария 2"
},
{
"username": ользователь3",
"text": "Текст комментария 3"
},
{
"username": ользователь4",
"text": "Текст комментария 4"
}
]
}
}

View File

@@ -0,0 +1,149 @@
{
"success": true,
"data": [
{
"id": 1,
"name": "The Witcher 3: Wild Hunt",
"image": "game1",
"text": "$10",
"imgPath": "img_top_1",
"description": "Эпическая RPG с открытым миром, в которой Геральт из Ривии охотится на монстров и раскрывает политические заговоры.",
"category": "RPG"
},
{
"id": 2,
"name": "Red Dead Redemption 2",
"image": "game2",
"text": "$10",
"imgPath": "img_top_2",
"description": "Приключенческая игра с открытым миром на Диком Западе, рассказывающая историю Артура Моргана.",
"category": "Adventures"
},
{
"id": 3,
"name": "Forza Horizon 5",
"image": "game3",
"text": "$10",
"imgPath": "img_top_3",
"description": "Гоночная игра с огромным открытым миром, действие которой происходит в Мексике.",
"category": "Race"
},
{
"id": 4,
"name": "Atomic Heart",
"image": "game4",
"text": "$10",
"imgPath": "img_top_4",
"description": "Экшен-шутер с элементами RPG, разворачивающийся в альтернативной Советской России.",
"category": "Shooters"
},
{
"id": 5,
"name": "Counter-Strike 2",
"image": "game5",
"text": "$10",
"imgPath": "img_top_5",
"description": "Популярный онлайн-шутер с соревновательным геймплеем и тактическими элементами.",
"category": "Shooters"
},
{
"id": 6,
"name": "Grand Theft Auto V",
"image": "game6",
"text": "$10",
"imgPath": "img_top_6",
"description": "Игра с открытым миром, где можно погрузиться в криминальный мир Лос-Сантоса.",
"category": "Adventures"
},
{
"id": 7,
"name": "Assassins Creed IV: Black Flag",
"image": "game7",
"text": "$10",
"imgPath": "img_top_7",
"description": "Приключенческая игра о пиратах и морских сражениях в эпоху золотого века пиратства.",
"category": "Adventures"
},
{
"id": 8,
"name": "Spider-Man",
"image": "game8",
"text": "$10",
"imgPath": "img_top_8",
"description": "Игра о супергерое Человеке-пауке с захватывающими битвами и паркуром по Нью-Йорку.",
"category": "Action"
},
{
"id": 9,
"name": "Assassins Creed Mirage",
"image": "game9",
"text": "$10",
"imgPath": "img_top_9",
"description": "Приключенческая игра с упором на скрытность, вдохновленная классическими частями серии.",
"category": "Action"
},
{
"id": 10,
"name": "Assassins Creed Valhalla",
"image": "game10",
"text": "$10",
"imgPath": "img_top_10",
"description": "RPG с открытым миром о викингах, включающая битвы, исследования и строительство поселений.",
"category": "RPG"
},
{
"id": 11,
"name": "ARK: Survival Evolved",
"image": "game11",
"text": "$10",
"imgPath": "img_top_11",
"description": "Выживание в открытом мире с динозаврами, строительством и многопользовательскими элементами.",
"category": "Simulators"
},
{
"id": 12,
"name": "FIFA 23",
"image": "game12",
"text": "$10",
"imgPath": "img_top_12",
"description": "Популярный футбольный симулятор с улучшенной графикой и реалистичным геймплеем.",
"category": "Sports"
},
{
"id": 13,
"name": "Dirt 5",
"image": "game13",
"text": "$10",
"imgPath": "img_top_13",
"description": "Аркадная гоночная игра с фокусом на ралли и внедорожных соревнованиях.",
"category": "Race"
},
{
"id": 14,
"name": "Cyberpunk 2077",
"image": "game14",
"text": "$10",
"imgPath": "img_top_14",
"description": "RPG в киберпанк-сеттинге с нелинейным сюжетом и детализированным открытым миром.",
"category": "RPG"
},
{
"id": 15,
"name": "Age of Empires IV",
"image": "game15",
"text": "$10",
"imgPath": "img_top_15",
"description": "Классическая стратегия в реальном времени с историческими кампаниями.",
"category": "Strategies"
},
{
"id": 16,
"name": "Civilization VI",
"image": "game16",
"text": "$10",
"imgPath": "img_top_16",
"description": "Глобальная пошаговая стратегия, в которой игроки строят и развивают цивилизации.",
"category": "Strategies"
}
]
}

View File

@@ -0,0 +1,119 @@
{
"success": true,
"data": {
"topSail": [
{
"image": "game1",
"text": "$10",
"imgPath": "img_top_1"
},
{
"image": "game2",
"text": "$10",
"imgPath": "img_top_2"
},
{
"image": "game3",
"text": "$10",
"imgPath": "img_top_3"
},
{
"image": "game4",
"text": "$10",
"imgPath": "img_top_4"
},
{
"image": "game5",
"text": "$10",
"imgPath": "img_top_5"
},
{
"image": "game6",
"text": "$10",
"imgPath": "img_top_6"
},
{
"image": "game7",
"text": "$10",
"imgPath": "img_top_7"
},
{
"image": "game8",
"text": "$10",
"imgPath": "img_top_8"
}
],
"categories": [
{
"image": "category1",
"text": "гонки",
"imgPath": "img_categories_1",
"category": "Race"
},
{
"image": "category2",
"text": "глубокий сюжет",
"imgPath": "img_categories_2",
"category": ""
},
{
"image": "category3",
"text": "симуляторы",
"imgPath": "img_categories_3",
"category": "Simulators"
},
{
"image": "category4",
"text": "открытый мир",
"imgPath": "img_categories_4",
"category": "RPG"
},
{
"image": "category5",
"text": "экшен",
"imgPath": "img_categories_5",
"category": "Action"
},
{
"image": "category6",
"text": "стратегии",
"imgPath": "img_categories_6",
"category": "Strategies"
},
{
"image": "category7",
"text": "шутеры",
"imgPath": "img_categories_7",
"category": "Shooters"
},
{
"image": "category8",
"text": "приключения",
"imgPath": "img_categories_8",
"category": "Adventures"
}
],
"news": [
{
"image": "news1",
"text": "Разработчики Delta Force: Hawk Ops представили крупномасштабный режим Havoc Warfare",
"imgPath": "img_news_1"
},
{
"image": "news2",
"text": "Первый трейлер Assassins Creed Shadows — с темнокожим самураем в феодальной Японии",
"imgPath": "img_news_2"
},
{
"image": "news3",
"text": "Призрак Цусимы» вышел на ПК — и уже ставит рекорды для Sony",
"imgPath": "img_news_3"
},
{
"image": "news4",
"text": "Авторы Skull and Bones расширяют планы на второй сезо",
"imgPath": "img_news_4"
}
]
}
}

View File

@@ -0,0 +1,37 @@
{
"success":true,
"data":
[
{
"id": 1,
"title": "Mortal Kombat 11",
"image": "mortal",
"alt": "Игра Мортал Комбат 11, картинка",
"releaseDate": "23 апр. 2019",
"description": "MORTAL KOMBAT 11 ULTIMATE ВКЛЮЧАЕТ В СЕБЯ БАЗОВУЮ ИГРУ МК11, КОМВАТ РАСК 1, ДОПОЛНЕНИЕ «ПОСЛЕДСТВИЯ» И НЕДАВНО ДОБАВЛЕННЫЙ НАБОР «КОМБАТ 2».",
"price": 300
},
{
"id": 2,
"title": "EA SPORTS™ FIFA 23",
"image": "fifa",
"alt": "Игра Фифа, картинка",
"releaseDate": "30 сен. 2022",
"description": "В FIFA 23 всемирная игра становится еще лучше с технологией HyperMotion2, мужским и женским FIFA World Cup™, женскими командами, кроссплатформенной игрой и множеством прочих возможностей.",
"price": 300
},
{
"id": 3,
"title": "Ведьмак: Дикая Охота",
"image": "ved",
"alt": "Игра Ведьмак, картинка",
"releaseDate": "18 мая 2015",
"description": "Вы — Геральт из Ривии, наемный убийца чудовищ. Вы путешествуете по миру, в котором бушует война и на каждом шагу подстерегают чудовища. Вам предстоит выполнить заказ и найти Цири — Дитя Предназначения, живое оружие, способное изменить облик этого мира.",
"price": 300
}
]
}