From 0d52ef187a827cb4317d612ad4e70ebee0cb8a6b Mon Sep 17 00:00:00 2001 From: nightbug-xx Date: Mon, 9 Jun 2025 18:41:11 +0900 Subject: [PATCH] feat: load API base URL from env --- .env.example | 5 +++++ src/lib/api.ts | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..90bf525 --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +# Rename this file to .env and set the API base URL for your environment +# Example: +# VITE_API_BASE_URL=http://localhost:8000 +VITE_API_BASE_URL=https://api.example.com + diff --git a/src/lib/api.ts b/src/lib/api.ts index 9c788fe..2271829 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -1,8 +1,7 @@ import axios from 'axios' const api = axios.create({ - baseURL: 'https://api.biryu2000.kr', - // baseURL: 'http://localhost:8000', + baseURL: import.meta.env.VITE_API_BASE_URL, }) // 요청 시 토큰 자동 추가