fix: 完善 API 基础设施验收

This commit is contained in:
root
2026-09-14 13:30:03 +08:00
parent f3fb16dbc0
commit 61562f6893
5 changed files with 201 additions and 17 deletions
+6 -2
View File
@@ -30,8 +30,12 @@ export function configureApp(app: INestApplication): void {
});
}
async function bootstrap(): Promise<void> {
const app = await NestFactory.create(AppModule);
type AppFactory = () => Promise<INestApplication>;
export async function bootstrap(
appFactory: AppFactory = () => NestFactory.create(AppModule),
): Promise<void> {
const app = await appFactory();
configureApp(app);
app.enableShutdownHooks();
await app.listen(Number(process.env.PORT ?? 3001), "0.0.0.0");