mirror of
https://github.com/vee1e/krply.git
synced 2026-09-01 09:49:51 +00:00
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:
parent
9155ea248c
commit
994633da65
1 changed files with 7 additions and 1 deletions
|
|
@ -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; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue