The best way to control Claude Code, Codex and more from any computer or phone
| 1 | // Selected via `config: "vite.proxy.config.mjs"` by the local suite: the |
| 2 | // dev server proxies `/api/*` to a target the stack resolves from another |
| 3 | // resource's `Output` and hands over through the site's `env`. |
| 4 | const target = process.env.API_PROXY_TARGET; |
| 5 | |
| 6 | export default { |
| 7 | server: { |
| 8 | proxy: target |
| 9 | ? { |
| 10 | "/api": { |
| 11 | target, |
| 12 | changeOrigin: true, |
| 13 | rewrite: (path) => path.replace(/^\/api/, ""), |
| 14 | }, |
| 15 | } |
| 16 | : undefined, |
| 17 | }, |
| 18 | }; |