Commit Graph

9 Commits

Author SHA1 Message Date
lichao 914e156cc6 fix: 修复 Vercel 部署 404 和 Swagger 无法访问
- vercel.json: builds.src 从 package.json 改为 api/index.ts,routes.dest 从 /dist/api/index.js 改为 /api
- api/index.ts: 修正 require 路径,移除多余的 src/ 前缀
- api/index.ts: Swagger 挂载路径从 /api 改为 /docs,避免与 Vercel 函数路径冲突
- package.json: 添加 vercel-build 脚本确保部署前编译 NestJS
2026-03-04 19:30:07 +08:00
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
golc 1d8213f6ed feat: 配置 Vercel serverless 部署支持
- 更新 vercel.json 使用 serverless 函数入口
- 添加 api/index.ts 作为 Vercel serverless handler
- 添加 .env.vercel 环境变量配置模板
- 支持 Swagger 文档在 serverless 环境运行

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 09:19:00 +00:00
lichao c505421544 fix: use npx for nest build commands to avoid permission issues 2026-02-25 12:04:54 +00:00
lichao 1dc6715345 fix: add buildCommand and outputDirectory to vercel.json 2026-02-25 11:59:30 +00:00
golc ec17b894a6 feat: initial commit with Vercel CI/CD 2026-02-25 09:42:55 +00:00
golc 443e2b6518 fix: 修正 Vercel 配置指向构建后的文件
- 将 vercel.json 中的入口文件从 src/main.ts 改为 dist/main.js
- 确保 Vercel 使用编译后的 JavaScript 文件

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 14:26:22 +00:00
golc b88b4d5156 feat: 迁移到 Vercel 部署
- 移除 Gitea Actions 配置
- 添加 Vercel 配置文件
- 配置 Serverless 函数路由

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 13:50:35 +00:00