2023-04-17 08:48:13 +00:00
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
export async function getUrl(route, appName = 'salix') {
|
|
|
|
const filter = {
|
2023-07-10 04:04:05 +00:00
|
|
|
where: { and: [{ appName: appName }, { environment: process.env.NODE_ENV }] },
|
2023-04-17 08:48:13 +00:00
|
|
|
};
|
|
|
|
|
2023-10-03 07:25:28 +00:00
|
|
|
const { data } = await axios.get('Urls/findOne', { params: { filter } });
|
|
|
|
const url = data.url;
|
|
|
|
return route ? url + route : url;
|
2023-04-17 08:48:13 +00:00
|
|
|
}
|