feat: load API base URL from env

This commit is contained in:
nightbug-xx 2025-06-09 18:41:11 +09:00
parent 2166685131
commit 0d52ef187a
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'
const api = axios.create({
baseURL: 'https://api.biryu2000.kr',
// baseURL: 'http://localhost:8000',
baseURL: import.meta.env.VITE_API_BASE_URL,
})
// 요청 시 토큰 자동 추가