[PIE-2] Replace hardcoded PB URL #3
@ -1,4 +1,4 @@
|
|||||||
PB_ADMIN_EMAIL=admin@example.com
|
PB_ADMIN_EMAIL=admin@example.com
|
||||||
PB_ADMIN_PASSWORD=secret-password
|
PB_ADMIN_PASSWORD=secret-password
|
||||||
PB_URL=http://pocketbase:8080
|
PUBLIC_PB_URL=http://pb:8080
|
||||||
PB_DATA_DIR=/pb/pb_data
|
PB_DATA_DIR=/pb/pb_data
|
@ -10,7 +10,7 @@ import type {
|
|||||||
} from "pocketbase";
|
} from "pocketbase";
|
||||||
import { readable, type Readable, type Subscriber } from "svelte/store";
|
import { readable, type Readable, type Subscriber } from "svelte/store";
|
||||||
import { browser } from "$app/environment";
|
import { browser } from "$app/environment";
|
||||||
// import { PB_URL } from "$env/static/private";
|
import { PUBLIC_PB_URL } from "$env/static/public";
|
||||||
import { base } from "$app/paths";
|
import { base } from "$app/paths";
|
||||||
import { invalidateAll } from "$app/navigation";
|
import { invalidateAll } from "$app/navigation";
|
||||||
import type { TypedPocketBase } from "./pocketbase-types"; // npx pocketbase-typegen --url http://localhost:8080 --email admin@example.com --password 'secret-password'
|
import type { TypedPocketBase } from "./pocketbase-types"; // npx pocketbase-typegen --url http://localhost:8080 --email admin@example.com --password 'secret-password'
|
||||||
@ -20,11 +20,7 @@ import type { TypedPocketBase } from "./pocketbase-types"; // npx pocketbase-typ
|
|||||||
// } from "@simplewebauthn/browser";
|
// } from "@simplewebauthn/browser";
|
||||||
// import { alerts } from "$lib/components/Alerts.svelte";
|
// import { alerts } from "$lib/components/Alerts.svelte";
|
||||||
|
|
||||||
export const client = new PocketBase(
|
export const client = new PocketBase(PUBLIC_PB_URL) as TypedPocketBase;
|
||||||
// browser ? window.location.origin + base : undefined
|
|
||||||
// "http://pb:8080"
|
|
||||||
"http://localhost:8080" // FIXME: use env
|
|
||||||
) as TypedPocketBase;
|
|
||||||
|
|
||||||
export const authModel = readable<AuthModel | null>(
|
export const authModel = readable<AuthModel | null>(
|
||||||
null,
|
null,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user