feat(web): default public ui to the render-hosted api

- krply.lverma.com and the vercel prod domain now query the
  krply-server backend on render instead of the static origin
This commit is contained in:
lakshit verma 2026-08-06 05:53:41 +05:30
parent 9155ea248c
commit 994633da65
No known key found for this signature in database
GPG key ID: EB498AFC60A7A01A

View file

@ -6,7 +6,13 @@
const LS_KEY = 'krply.server';
const fromURL = new URLSearchParams(location.search).get('server');
let base = (fromURL || localStorage.getItem(LS_KEY) || '').replace(/\/+$/, '');
const PROD_HOSTS = new Set([
'krply.lverma.com',
'krply-web-lakshit-vermas-projects.vercel.app',
]);
const DEFAULT_SERVER = PROD_HOSTS.has(location.hostname) ? 'https://krply-server.onrender.com' : '';
let base = (fromURL || localStorage.getItem(LS_KEY) || DEFAULT_SERVER).replace(/\/+$/, '');
export function serverURL() { return base; }