From 52ddad10005237cdf1f8f12996d1c5e105bcb4ba Mon Sep 17 00:00:00 2001 From: hailin Date: Tue, 9 Dec 2025 21:51:58 -0800 Subject: [PATCH] fix(api-gateway): correct Kong routes and add missing globalPrefix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Kong: change /api/v1/plantings to /api/v1/planting (match controller) - reward-service: add missing app.setGlobalPrefix('api/v1') 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- backend/api-gateway/kong.yml | 3 +-- backend/services/reward-service/src/main.ts | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/api-gateway/kong.yml b/backend/api-gateway/kong.yml index b4382931..ed7dc044 100644 --- a/backend/api-gateway/kong.yml +++ b/backend/api-gateway/kong.yml @@ -87,8 +87,7 @@ services: routes: - name: planting-api paths: - - /api/v1/plantings - - /api/v1/trees + - /api/v1/planting strip_path: false # --------------------------------------------------------------------------- diff --git a/backend/services/reward-service/src/main.ts b/backend/services/reward-service/src/main.ts index dbb3e1ca..c5754f11 100644 --- a/backend/services/reward-service/src/main.ts +++ b/backend/services/reward-service/src/main.ts @@ -24,6 +24,9 @@ async function bootstrap() { // 跨域配置 app.enableCors(); + // API 前缀 + app.setGlobalPrefix('api/v1'); + // Swagger 配置 const config = new DocumentBuilder() .setTitle('Reward Service API')