30 lines
645 B
TypeScript
30 lines
645 B
TypeScript
|
|
/**config api */
|
||
|
|
import { ref } from 'vue'
|
||
|
|
|
||
|
|
const env = ref<string>(process.env.NODE_ENV || 'development')
|
||
|
|
export const apiUrlConfig = import.meta.env.VITE_API_URI_CONFIG
|
||
|
|
// if (process.env.VUE_APP_TEST) {
|
||
|
|
// env = "test";
|
||
|
|
// }
|
||
|
|
|
||
|
|
const config = ref<any>({
|
||
|
|
development: {
|
||
|
|
// API_URI: "https://localhost:7260/api",
|
||
|
|
API_URI: 'https://bma-ehr.frappet.synology.me/api/v1',
|
||
|
|
},
|
||
|
|
test: {
|
||
|
|
API_URI: 'http://localhost:5010/api/v1',
|
||
|
|
},
|
||
|
|
production: {
|
||
|
|
API_URI: apiUrlConfig,
|
||
|
|
},
|
||
|
|
})
|
||
|
|
|
||
|
|
const API_URI = ref<string>(config.value[env.value].API_URI)
|
||
|
|
|
||
|
|
export default {
|
||
|
|
env: env.value,
|
||
|
|
config: config.value,
|
||
|
|
API_URI: API_URI.value,
|
||
|
|
}
|