mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-14 16:51:33 +10:00
lay the ground work for sentry integration
This commit is contained in:
@ -1,7 +1,10 @@
|
||||
import '@sentry/tracing';
|
||||
|
||||
import { Logger, ValidationPipe } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { NestExpressApplication } from '@nestjs/platform-express';
|
||||
import * as Sentry from '@sentry/node';
|
||||
import cookieParser from 'cookie-parser';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
@ -18,6 +21,16 @@ const bootstrap = async () => {
|
||||
// Pipes
|
||||
app.useGlobalPipes(new ValidationPipe({ transform: true }));
|
||||
|
||||
// Sentry Error Logging
|
||||
const sentryDSN = configService.get<string>('logging.sentryDSN');
|
||||
if (sentryDSN) {
|
||||
Sentry.init({
|
||||
dsn: sentryDSN,
|
||||
tracesSampleRate: 1.0,
|
||||
enabled: process.env.NODE_ENV === 'production',
|
||||
});
|
||||
}
|
||||
|
||||
// Server Port
|
||||
const port = configService.get<number>('app.port');
|
||||
await app.listen(port);
|
||||
|
||||
Reference in New Issue
Block a user