Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { NestFactory } from '@nestjs/core';
import { ValidationPipe } from '@nestjs/common';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { CrudConfigService } from '@nestjsx/crud';
import { USER_REQUEST_KEY } from './constants';
// Important: load config before (!!!) you import AppModule
// https://github.com/nestjsx/crud/wiki/Controllers#global-options
CrudConfigService.load({
auth: {
property: USER_REQUEST_KEY,
},
routes: {
// exclude: ['createManyBase'],
},
});
import { HttpExceptionFilter } from '../shared/https-exception.filter';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.useGlobalPipes(new ValidationPipe());
app.useGlobalFilters(new HttpExceptionFilter());
import { CrudConfigService } from '@nestjsx/crud';
/**
* Configure CRUD defaults
*/
CrudConfigService.load({
query: {
limit: 25,
maxLimit: 250,
},
routes: {
// exclude /bulk
exclude: ['createManyBase'],
},
params: {
id: {
field: 'id',
type: 'uuid',
primary: true,
},
},
});