Fix production web API routing
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
const normalize = (value) => String(value || '').replace(/\/$/, '');
|
||||
|
||||
export const resolveApiUrl = () => {
|
||||
if (typeof window !== 'undefined' && window.location?.hostname === 'sign.linkedcorp.net') {
|
||||
return '/api';
|
||||
}
|
||||
|
||||
return normalize(import.meta.env.VITE_API_URL || 'http://192.168.222.40:4000');
|
||||
};
|
||||
|
||||
export const resolveAndroidApkUrl = () => {
|
||||
if (typeof window !== 'undefined' && window.location?.hostname === 'sign.linkedcorp.net') {
|
||||
return '/api/downloads/android-apk';
|
||||
}
|
||||
|
||||
return `${resolveApiUrl()}/downloads/android-apk`;
|
||||
};
|
||||
Reference in New Issue
Block a user