-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from gbgabiola/chore/configs
Enhance the codebase by adding config files
- Loading branch information
Showing
11 changed files
with
165 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DB_HOST=localhost | ||
DB_PORT= 5432 | ||
DB_USERNAME=postgres | ||
DB_PASSWORD=mypass | ||
DB_NAME=task-management | ||
JWT_SECRET=hKs2z!Zzm\[p'fbY.X?e'[<cSaXfu.5NxUu<WQHZ3Gm'&xHub)zZ@*x`k#;Z'z=9 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as Joi from 'joi'; | ||
|
||
export const configValidationSchema = Joi.object({ | ||
STAGE: Joi.string().required(), | ||
DB_HOST: Joi.string().required(), | ||
DB_PORT: Joi.number().default(5432).required(), | ||
DB_USERNAME: Joi.string().required(), | ||
DB_PASSWORD: Joi.string().required(), | ||
DB_NAME: Joi.string().required(), | ||
JWT_SECRET: Joi.string().required(), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
import { ValidationPipe } from '@nestjs/common'; | ||
import { Logger, ValidationPipe } from '@nestjs/common'; | ||
import { NestFactory } from '@nestjs/core'; | ||
import { AppModule } from './app.module'; | ||
import { TransformInterceptor } from './transform.interceptor'; | ||
|
||
async function bootstrap() { | ||
const logger = new Logger(); | ||
const port = 3000; | ||
const app = await NestFactory.create(AppModule); | ||
app.useGlobalPipes(new ValidationPipe()); | ||
app.useGlobalInterceptors(new TransformInterceptor()); | ||
await app.listen(3000); | ||
await app.listen(port); | ||
logger.log(`Application listening on port ${port}...`); | ||
} | ||
bootstrap(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters