fix: PocketBase URL protocol handling
This commit is contained in:
parent
29f002650f
commit
721b9960c8
@ -1,3 +1,7 @@
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
export const pb = new PocketBase(import.meta.env.VITE_POCKETBASE_URL);
|
||||
const rawUrl = import.meta.env.VITE_POCKETBASE_URL ?? '';
|
||||
// Ensure URL always has a protocol so PocketBase SDK treats it as absolute
|
||||
const pbUrl = rawUrl.startsWith('http') ? rawUrl : `https://${rawUrl}`;
|
||||
|
||||
export const pb = new PocketBase(pbUrl);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user