diff --git a/astro.config.mjs b/astro.config.mjs index 6d3c92c..a67d809 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -14,6 +14,15 @@ export default defineConfig({ }), vite: { - plugins: [tailwindcss()] + plugins: [tailwindcss()], + server: { + proxy: { + '/api': { + target: 'http://localhost:8080', + changeOrigin: true, + rewrite: (path) => path.replace(/^\/api/, '/api'), + }, + } + } } }); \ No newline at end of file diff --git a/src/data/pocketbase.ts b/src/data/pocketbase.ts index 10a2a1b..b39559f 100644 --- a/src/data/pocketbase.ts +++ b/src/data/pocketbase.ts @@ -1,4 +1,5 @@ import Pocketbase from "pocketbase" -export const client = new Pocketbase(import.meta.env.PUBLIC_PB_URL) +const client = new Pocketbase(import.meta.env.PUBLIC_URL) +export default client; // export const client = new Pocketbase("http://localhost:8080") \ No newline at end of file