feat(frontend): make api base configurable

This commit is contained in:
Tim
2025-07-04 18:29:01 +08:00
parent 8519a80485
commit a7c6be2735
3 changed files with 12 additions and 3 deletions

View File

@@ -3,4 +3,11 @@ import App from './App.vue'
import router from './router'
import './assets/global.css'
// Configurable API domain and port
export const API_DOMAIN =
process.env.VUE_APP_API_DOMAIN ||
`${window.location.protocol}//${window.location.hostname}`
export const API_PORT = process.env.VUE_APP_API_PORT || window.location.port
export const API_BASE_URL = API_PORT ? `${API_DOMAIN}:${API_PORT}` : API_DOMAIN
createApp(App).use(router).mount('#app')