Add business images upload and cascade delete improvements.
This commit is contained in:
+5
-1
@@ -1,7 +1,9 @@
|
||||
import 'reflect-metadata';
|
||||
import { ValidationPipe } from '@nestjs/common';
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { NestExpressApplication } from '@nestjs/platform-express';
|
||||
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
||||
import { join } from 'path';
|
||||
import { TypeOrmExceptionFilter } from './common/filters/typeorm-exception.filter';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
@@ -18,7 +20,9 @@ function configureCors(app: Awaited<ReturnType<typeof NestFactory.create>>) {
|
||||
}
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
const app = await NestFactory.create<NestExpressApplication>(AppModule);
|
||||
const uploadDir = process.env.UPLOAD_DIR ?? 'uploads';
|
||||
app.useStaticAssets(join(process.cwd(), uploadDir), { prefix: '/uploads' });
|
||||
configureCors(app);
|
||||
app.useGlobalPipes(
|
||||
new ValidationPipe({
|
||||
|
||||
Reference in New Issue
Block a user