diff --git a/js/core/src/reflectionApi.ts b/js/core/src/reflectionApi.ts index aed10708cf..6b569c1f36 100644 --- a/js/core/src/reflectionApi.ts +++ b/js/core/src/reflectionApi.ts @@ -58,6 +58,7 @@ export async function startReflectionApi(port?: number | undefined) { if (!port) { port = Number(process.env.GENKIT_REFLECTION_PORT) || 3100; } + global[GLOBAL_REFLECTION_API_PORT_KEY] = port; const api = express(); @@ -300,7 +301,6 @@ export async function startReflectionApi(port?: number | undefined) { server = api.listen(port, () => { console.log(`Reflection API running on http://localhost:${port}`); - global[GLOBAL_REFLECTION_API_PORT_KEY] = port; }); server.on('error', (error) => {