Files
twenty/server/src/main.ts
brendanlaschke 35bcef5090 Add Sentry for Backend (#1403)
* - added sentry

* - renamed env var

* - logger driver

* - add breadcrumb and category

* - fix driver
2023-09-11 12:22:30 -07:00

43 lines
1.0 KiB
TypeScript

import { NestFactory } from '@nestjs/core';
import { ValidationPipe } from '@nestjs/common';
import * as bodyParser from 'body-parser';
import { graphqlUploadExpress } from 'graphql-upload';
import bytes from 'bytes';
import { AppModule } from './app.module';
import { settings } from './constants/settings';
import { LoggerService } from './integrations/logger/logger.service';
async function bootstrap() {
const app = await NestFactory.create(AppModule, {
cors: true,
});
// Apply validation pipes globally
app.useGlobalPipes(new ValidationPipe());
app.use(bodyParser.json({ limit: settings.storage.maxFileSize }));
app.use(
bodyParser.urlencoded({
limit: settings.storage.maxFileSize,
extended: true,
}),
);
// Graphql file upload
app.use(
graphqlUploadExpress({
maxFieldSize: bytes(settings.storage.maxFileSize),
maxFiles: 10,
}),
);
const loggerService = app.get(LoggerService);
app.useLogger(loggerService);
await app.listen(3000);
}
bootstrap();