Add proxy for easy external api access (DOCKER BROKEN!!)

This commit is contained in:
June 2025-08-12 17:57:01 +12:00
parent 5c099f5b49
commit f51b811b55
Signed by: breadone
GPG Key ID: FDC19FE143200483
2 changed files with 12 additions and 2 deletions

View File

@ -14,6 +14,15 @@ export default defineConfig({
}), }),
vite: { vite: {
plugins: [tailwindcss()] plugins: [tailwindcss()],
server: {
proxy: {
'/api': {
target: 'http://localhost:8080',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '/api'),
},
}
}
} }
}); });

View File

@ -1,4 +1,5 @@
import Pocketbase from "pocketbase" 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") // export const client = new Pocketbase("http://localhost:8080")