Built the Sentinel Tab

This commit is contained in:
Sagnik
2026-04-12 02:02:58 +05:30
parent fb656d1443
commit 075ab280ad
526 changed files with 17646 additions and 70931 deletions

19
app/src/lib/api.ts Normal file
View File

@@ -0,0 +1,19 @@
const rawApiBase = import.meta.env.VITE_API_URL?.trim();
const DEPLOYED_BACKEND_ORIGIN = 'https://54.152.236.10';
function getBrowserOrigin() {
if (typeof window !== 'undefined' && window.location?.origin) {
return window.location.origin;
}
return '';
}
export const API_URL = (
rawApiBase && rawApiBase.length > 0
? rawApiBase
: import.meta.env.DEV
? getBrowserOrigin()
: DEPLOYED_BACKEND_ORIGIN || getBrowserOrigin()
).replace(/\/$/, '');
export const WS_URL = API_URL.replace(/^http/, 'ws');