Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add config
Browse files Browse the repository at this point in the history
liglig999 committed May 4, 2024
1 parent 72d691b commit d49ad22
Showing 3 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/auth/src/auth.module.ts
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@ import { MongooseModule } from '@nestjs/mongoose';
import { UsersService } from './users/users.service';
import { UserSchema } from './users/users.schema';
import { LoggerModule } from '@app/common';
import * as Joi form 'joi';
import { ConfigModule } from '@nestjs/config';

@Module({
imports: [
@@ -18,6 +20,13 @@ import { LoggerModule } from '@app/common';
secret: jwtConstants.secret,
signOptions: { expiresIn: '60s' },
}),
ConfigModule.forRoot({
isGlobal: true,
validationSchema: Joi.object({
MONGODB_URI: Joi.string().default('mongodb://admin:secret@mongodb/'),
MONGODB_DATABASE: Joi.string().default('auth'),
}),
}),
MongooseModule.forRoot(
'mongodb://admin:secret@mongodb/auth?authSource=admin',
),
1 change: 1 addition & 0 deletions apps/gateway/src/gateway.module.ts
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ import { jwtConstants } from 'apps/auth/src/auth.constants';
import { APP_GUARD } from '@nestjs/core';
import { WorkoutsController } from './workouts.controller';
import { AuthGuard } from '@app/common';
import { LoggerModule } from '@app/common';

@Module({
imports: [
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@
"bcrypt": "^5.1.1",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"joi": "^17.12.3",
"cookie-parser": "^1.4.6",
"express": "^4.19.2",
"mongoose": "^8.2.4",
@@ -52,6 +53,7 @@
"@nestjs/testing": "^10.0.0",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.2",
"@types/joi": "^17.2.3",
"@types/node": "^20.3.1",
"@types/supertest": "^2.0.12",
"@typescript-eslint/eslint-plugin": "^6.0.0",

0 comments on commit d49ad22

Please sign in to comment.