A tiny server that safely proxies your Rocket app to real data sources (e.g., Apify) without exposing tokens.
npm i -g vercel
vercel login
vercelYou’ll get a URL like:
https://yieldpilot-proxy.vercel.app
ALLOWED_ORIGINS=https://yieldpilot.co.uk,https://yieldpilot.app,http://localhost:5173DATA_MODE=mock(switch toapifywhen ready)APIFY_TOKEN=your-apify-token(only needed forapifymode)APIFY_ACTOR_URL= your Apify actor/wrapper endpoint
-
GET /api/search?q=Manchester&page=1&pageSize=24&market=UKReturns{ total, page, pageSize, results[] } -
GET /api/properties/:idReturns a detailed object with charts, comps, risk, etc.
In the Rocket app, set:
VITE_API_BASE=https://YOUR-VERCEL-URL
Example fetch:
const API_BASE = import.meta.env.VITE_API_BASE;
const res = await fetch(`${API_BASE}/api/search?q=Manchester&page=1&pageSize=24`);
const data = await res.json();- Set
DATA_MODE=apify - Provide
APIFY_TOKENandAPIFY_ACTOR_URL - Adapt the mapping in
api/search.jsto your actor’s fields