Skip to content

Commit

Permalink
Merge pull request #6 from RnizereB/module4-task1
Browse files Browse the repository at this point in the history
Покоритель баз данных
  • Loading branch information
Paklosha authored Nov 6, 2024
2 parents 68fdafa + d11cd33 commit fa234bb
Show file tree
Hide file tree
Showing 125 changed files with 5,402 additions and 247 deletions.
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

0 comments on commit fa234bb

Please sign in to comment.