- 移除测试/控制器中未使用的导入与实例 - bills/classroom-rentals 改用 ESM 导入替代 require - bills.service 去掉多余断言、backfill 显式转字符串、main.ts void bootstrap
19 lines
495 B
TypeScript
19 lines
495 B
TypeScript
import { NestFactory } from '@nestjs/core';
|
|
import helmet from 'helmet';
|
|
import compression from 'compression';
|
|
import { AppModule } from './app.module';
|
|
import { runMigrationsOnStartup } from './migration-runner';
|
|
|
|
async function bootstrap() {
|
|
await runMigrationsOnStartup();
|
|
|
|
const app = await NestFactory.create(AppModule);
|
|
app.setGlobalPrefix('api');
|
|
app.enableCors();
|
|
app.use(helmet());
|
|
app.use(compression());
|
|
|
|
await app.listen(process.env.PORT ?? 3000);
|
|
}
|
|
void bootstrap();
|