Auto-set VITE_API_URL for React/Vite apps deployed to proxied container address #27

Closed
opened 2026-04-25 14:05:30 +00:00 by Mark · 2 comments
Owner

Problem

When deploying React/Vite full-stack apps to NodeHub, the frontend makes API calls to /api/* which gets proxied to the wrong destination. The app needs to call the full proxied URL (e.g., /proxy/app-xxx/api/*) instead of relative /api/*.

Current Workaround

Users must manually set VITE_API_URL environment variable to the full proxy path before deployment.

Expected Behavior

NodeHub should automatically detect Vite/React apps and set VITE_API_URL to the correct proxied container address (e.g., /proxy/{instanceId}/) so API calls work without manual configuration.

Example

For an app deployed at https://nodehub.example.com/proxy/app-123/, NodeHub should automatically set:

VITE_API_URL=/proxy/app-123

This way, frontend API calls like fetch("/api/users") become fetch("/proxy/app-123/api/users") which correctly routes to the backend.

Priority

High - blocks full-stack React app deployments

## Problem When deploying React/Vite full-stack apps to NodeHub, the frontend makes API calls to `/api/*` which gets proxied to the wrong destination. The app needs to call the full proxied URL (e.g., `/proxy/app-xxx/api/*`) instead of relative `/api/*`. ## Current Workaround Users must manually set `VITE_API_URL` environment variable to the full proxy path before deployment. ## Expected Behavior NodeHub should automatically detect Vite/React apps and set `VITE_API_URL` to the correct proxied container address (e.g., `/proxy/{instanceId}/`) so API calls work without manual configuration. ## Example For an app deployed at `https://nodehub.example.com/proxy/app-123/`, NodeHub should automatically set: ``` VITE_API_URL=/proxy/app-123 ``` This way, frontend API calls like `fetch("/api/users")` become `fetch("/proxy/app-123/api/users")` which correctly routes to the backend. ## Priority High - blocks full-stack React app deployments
Author
Owner

GSD RESEARCH phase failed: LLM provider timeout or error.
Retry on next pipeline tick.

GSD RESEARCH phase failed: LLM provider timeout or error. Retry on next pipeline tick.
Author
Owner

Fixed in commit. Closing.

Fixed in commit. Closing.
Mark closed this issue 2026-05-21 04:06:42 +00:00
Sign in to join this conversation.
No description provided.