hrms-recruit/src/api/index.ts

39 lines
1.1 KiB
TypeScript
Raw Normal View History

/**config api */
2023-03-23 12:30:14 +07:00
import { ref } from 'vue'
2023-03-23 12:30:14 +07:00
const env = ref<string>(process.env.NODE_ENV || 'development')
2024-08-09 13:47:21 +07:00
export const apiUrlConfig = `${import.meta.env.VITE_API_URI_CONFIG}`
2024-09-26 15:14:05 +07:00
export const apiUrlConfigV2 = `${import.meta.env.VITE_API_URI_REPORT_CONFIG}`
const config = ref<any>({
2023-03-23 12:30:14 +07:00
development: {
// API_URI: 'https://localhost:7007/api/v1',
2023-05-10 14:59:54 +07:00
API_URI: apiUrlConfig,
2023-10-08 13:58:43 +07:00
API_URI_V2: apiUrlConfigV2,
2023-03-23 12:30:14 +07:00
MEET_URI: 'meet.frappet.com'
},
test: {
API_URI: 'http://localhost:5010/api/v1',
2023-10-08 13:58:43 +07:00
API_URI_V2: 'http://localhost:5010/api/v2',
2023-03-23 12:30:14 +07:00
MEET_URI: 'meet.frappet.com'
},
production: {
// API_URI: "https://localhost:5010",
2023-05-10 14:59:54 +07:00
API_URI: apiUrlConfig,
2023-10-08 13:58:43 +07:00
API_URI_V2: apiUrlConfigV2,
2023-03-23 12:30:14 +07:00
MEET_URI: 'meet.frappet.com'
}
})
2023-03-23 12:30:14 +07:00
const API_URI = ref<string>(config.value[env.value].API_URI)
2023-10-08 13:58:43 +07:00
const API_URI_V2 = ref<string>(config.value[env.value].API_URI_V2)
2023-03-23 12:30:14 +07:00
const MEET_URI = ref<string>(config.value[env.value].MEET_URI)
export default {
2023-03-23 12:30:14 +07:00
env: env.value,
config: config.value,
API_URI: API_URI.value,
2023-10-08 13:58:43 +07:00
API_URI_V2: API_URI_V2.value,
2023-03-23 12:30:14 +07:00
MEET_URI: MEET_URI.value
}