From 87e303734a007707ba81ffce7b4c243f58b21169 Mon Sep 17 00:00:00 2001 From: hided62 Date: Sat, 25 Jul 2026 14:01:32 +0000 Subject: [PATCH] Route managed game APIs under profile prefixes --- app/game-api/src/server.ts | 3 +++ app/gateway-api/src/orchestrator/gatewayOrchestrator.ts | 3 +++ app/gateway-api/test/orchestratorPlan.test.ts | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/app/game-api/src/server.ts b/app/game-api/src/server.ts index 99aaa5b..145ebe9 100644 --- a/app/game-api/src/server.ts +++ b/app/game-api/src/server.ts @@ -84,6 +84,9 @@ export const createGameApiServer = async () => { const app = fastify({ logger: true, + routerOptions: { + maxParamLength: 2048, + }, }); await app.register(cors, { diff --git a/app/gateway-api/src/orchestrator/gatewayOrchestrator.ts b/app/gateway-api/src/orchestrator/gatewayOrchestrator.ts index 2ba32d4..041d17d 100644 --- a/app/gateway-api/src/orchestrator/gatewayOrchestrator.ts +++ b/app/gateway-api/src/orchestrator/gatewayOrchestrator.ts @@ -293,6 +293,9 @@ export const buildProcessDefinitions = ( PROFILE: profile.profile, SCENARIO: profile.scenario, GAME_API_PORT: String(profile.apiPort), + GAME_TRPC_PATH: `/${profile.profile}/api/trpc`, + GAME_API_EVENTS_PATH: `/${profile.profile}/api/events`, + GAME_UPLOAD_PATH: `/${profile.profile}/api/uploads`, GATEWAY_REDIS_PREFIX: config.redisKeyPrefix, GAME_TOKEN_SECRET: config.gameTokenSecret, }; diff --git a/app/gateway-api/test/orchestratorPlan.test.ts b/app/gateway-api/test/orchestratorPlan.test.ts index 6e893b5..9f6f8bc 100644 --- a/app/gateway-api/test/orchestratorPlan.test.ts +++ b/app/gateway-api/test/orchestratorPlan.test.ts @@ -83,6 +83,11 @@ describe('buildProcessDefinitions', () => { expect(definitions.api.cwd).toBe(path.join(buildWorkspace, 'app', 'game-api')); expect(definitions.api.script).toBe(path.join(buildWorkspace, 'app', 'game-api', 'dist', 'index.js')); + expect(definitions.api.env).toMatchObject({ + GAME_TRPC_PATH: '/che/api/trpc', + GAME_API_EVENTS_PATH: '/che/api/events', + GAME_UPLOAD_PATH: '/che/api/uploads', + }); expect(definitions.daemon.cwd).toBe(path.join(buildWorkspace, 'app', 'game-engine')); expect(definitions.daemon.script).toBe(path.join(buildWorkspace, 'app', 'game-engine', 'dist', 'index.js')); });