18 lines
663 B
TypeScript
18 lines
663 B
TypeScript
import { NestFactory } from '@nestjs/core';
|
|
import { ValidationPipe } from '@nestjs/common';
|
|
import { DataSource } from 'typeorm';
|
|
import { AppModule } from './app.module';
|
|
import { seedDefaultCampus } from './departments/seed';
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create(AppModule);
|
|
app.setGlobalPrefix('api');
|
|
app.enableCors();
|
|
app.useGlobalPipes(new ValidationPipe({ transform: true, whitelist: true }));
|
|
const dataSource = app.get(DataSource);
|
|
await seedDefaultCampus(dataSource);
|
|
await app.listen(process.env.PORT ?? 3003);
|
|
console.log(`Server running on http://localhost:${process.env.PORT ?? 3003}`);
|
|
}
|
|
bootstrap();
|