HTTP proxy server that forwards requests to http://localhost:20001.
We use this proxy because the Rubix node does not handle CORS. The proxy adds the required CORS headers so that browser-based requests work without errors.
- HTTP/HTTPS request forwarding
- CORS support
- Request logging
- Health check endpoint
- Error handling
- Configurable target URL
npm installDevelopment:
npm run devProduction:
npm startCustom port:
PORT=8080 npm startDefault target: http://localhost:20001. Change TARGET_URL in server.js to modify.
- GET /health: Returns server status
- All other routes: Forwarded to target URL with method, headers, body, and query string preserved
# Health check
curl http://localhost:3000/health
# Forward request
curl http://localhost:3000/api/data
# Goes to http://localhost:20001/api/dataRequests and proxy operations logged to console.
- Proxy errors return JSON responses
- Target unavailability handled with error messages