Commit Graph

3 Commits

Author SHA1 Message Date
golc f557f8581b fix: 修复 Vercel serverless 运行时崩溃
关键修复:
- 使用 require() 而非 import() 动态加载编译后的模块
- 从 dist/src/ 路径加载模块(Vercel 构建后的路径)
- 移除 tsconfig 中对 api 目录的排除
- 配置 vercel.json 路由到 dist/api/index.js

技术说明:
- api/index.ts 会被编译到 dist/api/index.js
- 运行时从 dist/src/app.module 加载 NestJS 应用
- 使用 require 避免 TypeScript 编译时路径检查

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 11:14:09 +00:00
golc 6cb67ead1e fix: 配置 Vercel serverless 部署
核心修改:
- 添加 express 依赖
- 创建 api/index.ts 作为 Vercel serverless 入口
- 从 src/ 导入模块,TypeScript 编译到 dist/
- 排除 api/ 目录不被编译
- 简化 vercel.json 配置
- 更新 pnpm-lock.yaml
- 设置 Node.js 20.x

技术细节:
- Vercel 自动识别 api/ 目录为 serverless 函数
- api/index.ts 映射到 /api 路由
- 使用 ExpressAdapter 和缓存提升性能
- 配置 CORS、全局管道、Swagger 文档

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 09:58:09 +00:00
lichao d2f6d3ebcc feat: 初始化项目 2025-01-08 19:46:50 +08:00