From 84007475c38b6f0274b7342a8f10efd5d859407b Mon Sep 17 00:00:00 2001 From: golc <2483469113@qq.com> Date: Wed, 4 Mar 2026 09:36:16 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20express=20=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用 ES6 默认导入替代 namespace 导入 - 修复 "express is not a function" 错误 Co-Authored-By: Claude Sonnet 4.6 --- api/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/index.ts b/api/index.ts index f68f0e1..8af7f64 100644 --- a/api/index.ts +++ b/api/index.ts @@ -2,8 +2,8 @@ import { NestFactory } from '@nestjs/core'; import { ExpressAdapter } from '@nestjs/platform-express'; import { ValidationPipe } from '@nestjs/common'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; -import * as express from 'express'; -import * as bodyParser from 'body-parser'; +import express from 'express'; +import bodyParser from 'body-parser'; import { join } from 'path'; // 缓存 app 实例,避免每次冷启动都重新创建