fix: 修复 express 导入方式

- 使用 ES6 默认导入替代 namespace 导入
- 修复 "express is not a function" 错误

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
golc 2026-03-04 09:36:16 +00:00
parent aef3acb6dc
commit 84007475c3
1 changed files with 2 additions and 2 deletions

View File

@ -2,8 +2,8 @@ import { NestFactory } from '@nestjs/core';
import { ExpressAdapter } from '@nestjs/platform-express'; import { ExpressAdapter } from '@nestjs/platform-express';
import { ValidationPipe } from '@nestjs/common'; import { ValidationPipe } from '@nestjs/common';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import * as express from 'express'; import express from 'express';
import * as bodyParser from 'body-parser'; import bodyParser from 'body-parser';
import { join } from 'path'; import { join } from 'path';
// 缓存 app 实例,避免每次冷启动都重新创建 // 缓存 app 实例,避免每次冷启动都重新创建