Merge pull request #4 from nightbug-xx/codex/configure-api-server-url-in-environment-files

feat: load API base URL from env
This commit is contained in:
nightbug-xx 2025-06-09 18:43:19 +09:00 committed by GitHub
commit 6302c85d0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

5
.env.example Normal file
View File

@ -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

View File

@ -1,8 +1,7 @@
import axios from 'axios' import axios from 'axios'
const api = axios.create({ const api = axios.create({
baseURL: 'https://api.biryu2000.kr', baseURL: import.meta.env.VITE_API_BASE_URL,
// baseURL: 'http://localhost:8000',
}) })
// 요청 시 토큰 자동 추가 // 요청 시 토큰 자동 추가