The following environment variables must be set in your Render Service Dashboard:
| Variable | Description | Example |
|---|---|---|
HUGGINGFACEHUB_API_TOKEN |
Your Hugging Face API Token (Read access) | hf_... |
PINECONE_API_KEY |
Your Pinecone API Key | pcsk_... |
If not using render.yaml, ensure your Start Command is set to:
uvicorn main:app --host 0.0.0.0 --port $PORTNote: The default
uvicorn main:apponly listens on127.0.0.1, which will cause 502 Bad Gateway errors on Render.
The following environment variables must be set in your Vercel Project Settings:
| Variable | Description |
| ------------------------- | ---------------------------------------------------- | ------------------------------------ |
| NEXT_PUBLIC_BACKEND_URL | The URL of your deployed backend (no trailing slash) | https://your-app-name.onrender.com |
If you see a CORS error accompanied by a 502 Bad Gateway:
- It's likely not a CORS issue. It's a startup issue.
- The 502 means Render can't reach your app.
- Because the app didn't reply, no CORS headers were sent.
- Fix: Ensure the backend
Start Commandincludes--host 0.0.0.0.