From 0342c96b28664d4b2d32b6aeee42a1525f35fb6b Mon Sep 17 00:00:00 2001 From: Hyojin Ahn Date: Thu, 18 Jun 2026 08:28:14 -0400 Subject: [PATCH] =?UTF-8?q?=EC=84=9C=EB=B2=84=20=ED=99=98=EA=B2=BD?= =?UTF-8?q?=EC=97=90=20=EB=A7=9E=EA=B2=8C=20config=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 11 +++++++++++ .gitignore | 1 - vite.config.js | 6 +++--- 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..ad02ea4 --- /dev/null +++ b/.env @@ -0,0 +1,11 @@ +# Dev uses the Vite proxy (see vite.config.js), so these are SAME-ORIGIN relative paths. +# The proxy forwards them to the Spring Boot backend, so the browser never makes a +# cross-origin request and CORS is avoided entirely in development. +VITE_AUTH_SERVICE_URL=/auth-service +VITE_OPR_API_URL=/opr-rest-api +VITE_CRM_API_URL=/crm-rest-api + +# --- If you ever call the backend DIRECTLY (no proxy), use absolute URLs instead and +# --- configure CORS on the backend (allowCredentials=true + explicit origin, never "*"): +# VITE_AUTH_SERVICE_URL=http://localhost:8080/auth-service +# VITE_OPR_API_URL=http://localhost:8080/opr-service diff --git a/.gitignore b/.gitignore index 8d206f7..77d3ff2 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ dist/ build/ # Env and logs -.env *.log # Editor and system files diff --git a/vite.config.js b/vite.config.js index 09722b3..aefd748 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,9 +1,9 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' -const AUTH_BACKEND = 'http://localhost:8080' // auth-service -const CRM_BACKEND = 'http://localhost:8082' // crm-rest-api -const OPR_BACKEND = 'http://localhost:8083' // opr-rest-api +const AUTH_BACKEND = 'http://auth-service:8080' // auth-service +const CRM_BACKEND = 'http://crm-rest-api:8082' // crm-rest-api +const OPR_BACKEND = 'http://opr-rest-api:8083' // opr-rest-api // https://vite.dev/config/ export default defineConfig({