Fix production web API routing

This commit is contained in:
2026-04-23 14:29:47 -05:00
parent 51074d08c6
commit a96907b684
14 changed files with 45 additions and 21 deletions
+17
View File
@@ -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`;
};