20 lines
462 B
JavaScript
20 lines
462 B
JavaScript
|
import axios from 'axios';
|
||
|
|
||
|
export async function getUrl(route, appName = 'salix') {
|
||
|
let url;
|
||
|
const env = process.env.NODE_ENV === 'development' ? 'dev' : process.env.NODE_ENV;
|
||
|
const filter = {
|
||
|
where: {and: [
|
||
|
{appName: appName},
|
||
|
{environment: env}
|
||
|
]}
|
||
|
};
|
||
|
|
||
|
await axios.get('Urls/findOne', {params: {filter}})
|
||
|
.then(res => {
|
||
|
url = res.data.url + route;
|
||
|
});
|
||
|
|
||
|
return url;
|
||
|
}
|