Based on your Netlify dashboard, here's EXACTLY what to click:
Site Settings → Environment variables (left sidebar under "Build & deploy")
You're currently looking at the Build & Deploy settings page. You need to scroll down in the left sidebar to find "Environment variables".
- In the left sidebar, scroll down to find "Environment variables"
- Click on it
- You'll see a button "Add a variable" or "Declare variables"
- Click it and select "Add a single variable"
- Enter:
- Key:
VITE_API_URL - Value:
https://YOUR-RAILWAY-URL.up.railway.app/api - Scopes: Check ✓ "Production" and ✓ "Deploy previews"
- Key:
- Click "Create variable"
- Go to "Deploys" (in the left sidebar under "Project overview")
- Click "Trigger deploy" button (top right)
- Select "Clear cache and deploy site"
- Wait 2-3 minutes for deployment to complete
That's it! Your site will rebuild with the new environment variable and connect to your Railway backend instead of localhost.