Files
api_directorio/src/main.ts
T
2024-08-18 22:09:32 -06:00

21 lines
605 B
TypeScript

import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { NestExpressApplication } from '@nestjs/platform-express';
import * as path from 'path';
import * as bodyParser from 'body-parser';
async function bootstrap() {
const app = await NestFactory.create<NestExpressApplication>(AppModule);
app.enableCors();
app.use(bodyParser.json({ limit: '1mb' }));
app.use(bodyParser.urlencoded({ limit: '1mb', extended: true }));
app.useStaticAssets(path.join(__dirname, '..', 'imagenes'), {
prefix: '/imagenes/',
});
await app.listen(3000);
}
bootstrap();