add pocketbase

This commit is contained in:
2025-05-29 11:48:39 +02:00
parent 7ed70d58d2
commit 5f8f8b3dd3
25 changed files with 1484 additions and 48 deletions

15
composables/usePB.ts Normal file
View File

@ -0,0 +1,15 @@
// import { ref } from 'vue';
import pocketbase from "pocketbase";
export const usePB = () => {
const nuxtApp = useNuxtApp();
const isServer = !!nuxtApp.ssrContext;
if (isServer) {
const pb = new pocketbase(process.env.POCKETBASE_URL || "http://127.0.0.1:8090");
return pb;
}
const pb = new pocketbase(window.location.origin);
return pb;
};