Skip to content

Commit

Permalink
enable logging via environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaidar committed Apr 13, 2019
1 parent af4e8e4 commit 52f9efe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,24 @@ const port = process.env.PORT;
async function bootstrap() {
const app = await NestFactory.create(
AppModule.forRoot(await getDbConnectionOptions(process.env.NODE_ENV)),
{
logger: Boolean(process.env.ENABLELOGGING),
},
);

/**
* Apply validation for all inputs globally
*/
app.useGlobalPipes(
new ValidationPipe({
/**
* Strip away all none-object existing properties
*/
whitelist: true,
/***
* Transform input objects to their corresponding DTO objects
*/
transform: true,
}),
);

Expand Down

0 comments on commit 52f9efe

Please sign in to comment.