수정본
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:8000'
|
||||
const WS_BASE_URL = import.meta.env.VITE_WS_URL || 'ws://localhost:8000'
|
||||
|
||||
// WebSocket URL: 현재 페이지 기준으로 자동 결정 (Docker/로컬 모두 호환)
|
||||
const deriveWsUrl = () => {
|
||||
const env = import.meta.env.VITE_WS_URL
|
||||
if (env) return env
|
||||
const proto = window.location.protocol === 'https:' ? 'wss:' : 'ws:'
|
||||
return `${proto}//${window.location.host}`
|
||||
}
|
||||
const WS_BASE_URL = deriveWsUrl()
|
||||
|
||||
export const config = {
|
||||
apiBaseUrl: API_BASE_URL,
|
||||
|
||||
Reference in New Issue
Block a user