This commit is contained in:
yoan
2024-08-23 13:22:44 +08:00
parent f394e34861
commit eac571934c
2 changed files with 32 additions and 1 deletions

View File

@@ -1,7 +1,9 @@
import PocketBase from "pocketbase";
const apiDomain = import.meta.env.VITE_API_DOMAIN;
console.log(apiDomain);
let pb: PocketBase;
export const getPb = () => {
if (pb) return pb;
pb = new PocketBase("http://127.0.0.1:8090");
pb = new PocketBase(apiDomain ? apiDomain : "http://127.0.0.1:8090");
return pb;
};