feat: auto-populate department_id on create + seed default campus with backfill
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
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}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user