From 08d1e5a717fa7cbb38aca5e03bd32bd4d4dc4f02 Mon Sep 17 00:00:00 2001 From: Ajax Davis Date: Thu, 4 Dec 2025 13:34:29 +1000 Subject: [PATCH] fix: use production API URL for tool search in Vercel deployments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change default TPMJS_API_URL to https://tpmjs.com in production - Keep localhost:3000 for local development - Fixes "ECONNREFUSED 127.0.0.1:3000" error in Vercel - Allows playground to search tools from production registry 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- packages/tools/search-registry/src/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/tools/search-registry/src/index.ts b/packages/tools/search-registry/src/index.ts index b9ef334..daf6bfc 100644 --- a/packages/tools/search-registry/src/index.ts +++ b/packages/tools/search-registry/src/index.ts @@ -64,8 +64,10 @@ export const searchTpmjsToolsTool = tool({ ...(category && { category }), }); - // Use environment variable or default to localhost for development - const baseUrl = process.env.TPMJS_API_URL || 'http://localhost:3000'; + // Use environment variable, or default to production API (falls back to localhost in dev) + const baseUrl = + process.env.TPMJS_API_URL || + (process.env.NODE_ENV === 'production' ? 'https://tpmjs.com' : 'http://localhost:3000'); const url = `${baseUrl}/api/tools/search?${params}`; console.log(`🌐 Fetching: ${url}`);