diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 6998829..7bcfc9e 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -34,7 +34,8 @@ services: - PUBLIC_HMR_HOST=localhost - PUBLIC_HMR_PROTOCOL=ws - PUBLIC_HMR_CLIENT_PORT=4321 - - PUBLIC_API_URL=http://localhost:8001/api/ + - PUBLIC_API_URL=http://localhost:4321/api/ + - PUBLIC_API_PROXY_TARGET=http://backend:8000 flower: container_name: 004erpflower diff --git a/frontend/astro.config.mjs b/frontend/astro.config.mjs index e83749a..3a35729 100644 --- a/frontend/astro.config.mjs +++ b/frontend/astro.config.mjs @@ -19,6 +19,7 @@ const allowedHosts = Array.from( const hmrHost = process.env.PUBLIC_HMR_HOST || 'localhost'; const hmrProtocol = process.env.PUBLIC_HMR_PROTOCOL || 'ws'; const hmrClientPort = Number(process.env.PUBLIC_HMR_CLIENT_PORT || 4321); +const apiProxyTarget = process.env.PUBLIC_API_PROXY_TARGET || 'http://localhost:8001'; export default defineConfig({ output: 'server', @@ -59,6 +60,12 @@ export default defineConfig({ host: hmrHost, clientPort: hmrClientPort, }, + proxy: { + '/api': { + target: apiProxyTarget, + changeOrigin: true, + }, + }, watch: { usePolling: true, interval: 100,