fix: 完善 API 基础设施验收
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user