Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Покоритель баз данных #6

Merged
merged 14 commits into from
Nov 6, 2024
11 changes: 11 additions & 0 deletions .env-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
PORT=3000
SALT=salt
DB_HOST=127.0.0.1
DB_NAME=six-cities
DB_USERNAME=Admin
DB_PASSWORD=admin
DB_PORT=27017
UPLOAD_DIRECTIRY=\upload
JWT_SECRET=secret
HOST=localhost
STATIC_DIRECTORY_PATH=static\
7 changes: 7 additions & 0 deletions custom.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { TokenPayload } from './src/shared/modules/auth/helpers/types.js';

declare module 'express-serve-static-core' {
export interface Request {
tokenPayload: TokenPayload;
}
}
28 changes: 28 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
services:
db:
image: mongo:4.2
restart: always
container_name: six-cities_mongodb
environment:
MONGO_INITDB_ROOT_USERNAME: ${DB_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${DB_PASSWORD}
ports:
- ${DB_PORT}:27017
volumes:
- six-cities_data:/data/db

db_ui:
image: mongo-express:latest
restart: always
container_name: six-cities_mongo_express
ports:
- 8081:8081
environment:
ME_CONFIG_BASICAUTH_USERNAME: ${DB_USERNAME}
ME_CONFIG_BASICAUTH_PASSWORD: ${DB_PASSWORD}
ME_CONFIG_MONGODB_ADMINUSERNAME: ${DB_USERNAME}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${DB_PASSWORD}
ME_CONFIG_MONGODB_URL: mongodb://${DB_USERNAME}:${DB_PASSWORD}@db:${DB_PORT}/

volumes:
six-cities_data:
12 changes: 7 additions & 5 deletions mocks/mock-server-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
],
"city": [
"Paris",
"Moscow",
"Kazan",
"St. Petersburg",
"Sochi"
"Cologne",
"Brussels",
"Amsterdam",
"Hamburg",
"Dusseldorf"
],
"previewImage": [
"previewImage1.jpg",
Expand All @@ -37,7 +38,8 @@
"type": [
"room",
"apartment",
"hotel"
"hotel",
"house"
],
"goods": [
"Kitchen",
Expand Down
7 changes: 7 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"watch": [
"src"
],
"ext": "ts, json",
"exec": "npm run ts ./src/main.rest.ts | pino-pretty --colorize --translateTime SYS:standard"
}
Loading
Loading