This commit is contained in:
ElEgEv 2023-12-12 01:08:10 +04:00
parent 9fea8e3bc4
commit 40f2191753
6 changed files with 1645 additions and 0 deletions

42
compose/server/.gitignore vendored Normal file
View File

@ -0,0 +1,42 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# Compiled output
/dist
/tmp
/out-tsc
/bazel-out
# Node
/node_modules
npm-debug.log
yarn-error.log
# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings
# System files
.DS_Store
Thumbs.db

115
compose/server/data.json Normal file
View File

@ -0,0 +1,115 @@
{
"nations": [
{
"id": 1,
"nationName": "СССР"
},
{
"id": 2,
"nationName": "Германия"
},
{
"id": 3,
"nationName": "США"
},
{
"id": 4,
"nationName": "Великобритания"
},
{
"id": 5,
"nationName": "Франция"
},
{
"id": 6,
"nationName": "Чехословакия"
},
{
"id": 7,
"nationName": "Швеция"
},
{
"id": 8,
"nationName": "Китай"
},
{
"id": 9,
"nationName": "Япония"
},
{
"id": 10,
"nationName": "Италия"
},
{
"id": 11,
"nationName": "Бангладеш"
},
{
"id": 12,
"nationName": "Зимбамбве"
},
{
"id": 13,
"nationName": "Гондурас"
},
{
"id": 14,
"nationName": "Майами"
}
],
"levels": [
{
"id": 1,
"level": 1
},
{
"id": 2,
"level": 2
},
{
"id": 3,
"level": 3
},
{
"id": 4,
"level": 4
},
{
"id": 5,
"level": 5
},
{
"id": 6,
"level": 6
},
{
"id": 7,
"level": 7
},
{
"id": 8,
"level": 8
},
{
"id": 9,
"level": 9
},
{
"id": 10,
"level": 10
}
],
"tank_images" : [ ],
"tanks": [ ],
"users" : [
{
"userId" : 100,
"nickname" : "3tankista73",
"email" : "egor.eliseev.1986@mail.ru",
"password" : "Tujh2003",
"role" : 1,
"balance" : 12300000
}
],
"users_tanks" : [ ]
}

View File

@ -0,0 +1,115 @@
{
"nations": [
{
"id": 1,
"nationName": "СССР"
},
{
"id": 2,
"nationName": "Германия"
},
{
"id": 3,
"nationName": "США"
},
{
"id": 4,
"nationName": "Великобритания"
},
{
"id": 5,
"nationName": "Франция"
},
{
"id": 6,
"nationName": "Чехословакия"
},
{
"id": 7,
"nationName": "Швеция"
},
{
"id": 8,
"nationName": "Китай"
},
{
"id": 9,
"nationName": "Япония"
},
{
"id": 10,
"nationName": "Италия"
},
{
"id": 11,
"nationName": "Бангладеш"
},
{
"id": 12,
"nationName": "Зимбамбве"
},
{
"id": 13,
"nationName": "Гондурас"
},
{
"id": 14,
"nationName": "Майами"
}
],
"levels": [
{
"id": 1,
"level": 1
},
{
"id": 2,
"level": 2
},
{
"id": 3,
"level": 3
},
{
"id": 4,
"level": 4
},
{
"id": 5,
"level": 5
},
{
"id": 6,
"level": 6
},
{
"id": 7,
"level": 7
},
{
"id": 8,
"level": 8
},
{
"id": 9,
"level": 9
},
{
"id": 10,
"level": 10
}
],
"tank_images": [],
"tanks": [],
"users": [
{
"userId": 100,
"nickname": "3tankista73",
"email": "egor.eliseev.1986@mail.ru",
"password": "Tujh2003",
"role": 1,
"balance": 12300000
}
],
"users_tanks": []
}

1335
compose/server/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
{
"name": "fake-db",
"version": "1.0.0",
"scripts": {
"start": "json-server --watch data.json --host 0.0.0.0 -p 8079"
},
"dependencies": {
},
"devDependencies": {
"json-server": "0.17.4"
}
}

26
compose/server/readme.md Normal file
View File

@ -0,0 +1,26 @@
Установка nodejs:
1. Заходим на сайт https://nodejs.org/en/
2. Скачиваем LTS версию
3. Устанавливаем
Переход в каталог с сервером:
```commandline
cd ./server
```
Установка зависимостей:
```commandline
npm install
```
Запуск:
```commandline
npm start
```
Примеры:
- http://localhost:8079
- http://localhost:8079/students
- http://localhost:8079/students?_expand=group
Документация -- https://www.npmjs.com/package/json-server