Spaces:
Sleeping
Sleeping
| import { NestFactory } from '@nestjs/core'; | |
| import { ValidationPipe } from '@nestjs/common'; | |
| import { NestExpressApplication } from '@nestjs/platform-express'; | |
| import { join } from 'path'; | |
| import { json, urlencoded } from 'express'; | |
| import { AppModule } from './app.module'; | |
| async function bootstrap() { | |
| const app = await NestFactory.create<NestExpressApplication>(AppModule); | |
| app.enableCors(); | |
| app.useGlobalPipes(new ValidationPipe()); | |
| // Increase the payload size limit for rich text content | |
| app.use(json({ limit: '50mb' })); | |
| app.use(urlencoded({ extended: true, limit: '50mb' })); | |
| // Serve static files from the uploads directory | |
| app.useStaticAssets(join(__dirname, '..', 'uploads'), { | |
| prefix: '/uploads/', | |
| }); | |
| await app.listen(process.env.PORT ?? 3001); | |
| } | |
| bootstrap(); | |