2024-12-16 17:12:39 +07:00
|
|
|
/**config api */
|
2024-12-17 13:27:08 +07:00
|
|
|
import { ref } from "vue";
|
2024-12-16 17:12:39 +07:00
|
|
|
|
2024-12-17 13:27:08 +07:00
|
|
|
const env = ref<string>(process.env.NODE_ENV || "development");
|
|
|
|
|
export const apiUrlConfig = import.meta.env.VITE_API_URI_CONFIG;
|
|
|
|
|
export const apiUrlSsoConfig = import.meta.env.VITE_API_SSO;
|
2024-12-16 17:12:39 +07:00
|
|
|
// if (process.env.VUE_APP_TEST) {
|
|
|
|
|
// env = "test";
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
const config = ref<any>({
|
|
|
|
|
development: {
|
|
|
|
|
// API_URI: "https://localhost:7260/api",
|
2024-12-17 13:27:08 +07:00
|
|
|
API_URI: "https://bma-ehr.frappet.synology.me/api/v1",
|
2024-12-17 18:12:45 +07:00
|
|
|
API_SSO: "https://localhost:3001/api/v1",
|
2024-12-16 17:12:39 +07:00
|
|
|
},
|
|
|
|
|
test: {
|
2024-12-17 13:27:08 +07:00
|
|
|
API_URI: "http://localhost:5010/api/v1",
|
2024-12-16 17:12:39 +07:00
|
|
|
},
|
|
|
|
|
production: {
|
|
|
|
|
API_URI: apiUrlConfig,
|
2024-12-17 13:27:08 +07:00
|
|
|
API_SSO: apiUrlSsoConfig,
|
2024-12-16 17:12:39 +07:00
|
|
|
},
|
2024-12-17 13:27:08 +07:00
|
|
|
});
|
2024-12-16 17:12:39 +07:00
|
|
|
|
2024-12-17 13:27:08 +07:00
|
|
|
const API_URI = ref<string>(config.value[env.value].API_URI);
|
|
|
|
|
const API_SSO = ref<string>(config.value[env.value].API_SSO);
|
2024-12-16 17:12:39 +07:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
env: env.value,
|
|
|
|
|
config: config.value,
|
|
|
|
|
API_URI: API_URI.value,
|
2024-12-17 13:27:08 +07:00
|
|
|
API_SSO: API_SSO.value,
|
|
|
|
|
};
|