Files
api_directorio/src/main.ts
T

21 lines
605 B
TypeScript
Raw Normal View History

2024-06-05 00:23:18 -06:00
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
2024-07-05 19:27:20 -06:00
import { NestExpressApplication } from '@nestjs/platform-express';
import * as path from 'path';
2024-08-18 22:09:32 -06:00
import * as bodyParser from 'body-parser';
2024-06-05 00:23:18 -06:00
async function bootstrap() {
2024-07-05 19:27:20 -06:00
const app = await NestFactory.create<NestExpressApplication>(AppModule);
2024-06-17 00:59:28 -06:00
app.enableCors();
2024-07-05 19:27:20 -06:00
2024-08-18 22:09:32 -06:00
app.use(bodyParser.json({ limit: '1mb' }));
app.use(bodyParser.urlencoded({ limit: '1mb', extended: true }));
2024-07-05 19:27:20 -06:00
app.useStaticAssets(path.join(__dirname, '..', 'imagenes'), {
prefix: '/imagenes/',
});
2024-08-18 22:09:32 -06:00
2024-06-05 00:23:18 -06:00
await app.listen(3000);
}
bootstrap();