This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import type { Handle } from "@sveltejs/kit";
|
||||
import { serve } from "bknd/adapter/sveltekit";
|
||||
import { serve } from "userbase/adapter/sveltekit";
|
||||
import { env } from "$env/dynamic/private";
|
||||
import config from "../bknd.config";
|
||||
import config from "../userbase.config";
|
||||
|
||||
const bkndHandler = serve(config, env);
|
||||
const userbaseHandler = serve(config, env);
|
||||
|
||||
export const handle: Handle = async ({ event, resolve }) => {
|
||||
// Handle bknd API requests
|
||||
// Handle userbase API requests
|
||||
const pathname = event.url.pathname;
|
||||
if (pathname.startsWith("/api/") || pathname.startsWith("/admin")) {
|
||||
const res = await bkndHandler(event);
|
||||
const res = await userbaseHandler(event);
|
||||
if (res.status !== 404) {
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { PageServerLoad } from "./$types";
|
||||
import { getApp } from "bknd/adapter/sveltekit";
|
||||
import { getApp } from "userbase/adapter/sveltekit";
|
||||
import { env } from "$env/dynamic/private";
|
||||
import config from "../../bknd.config";
|
||||
import config from "../../userbase.config";
|
||||
|
||||
export const load: PageServerLoad = async () => {
|
||||
const app = await getApp(config, env);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
let { data }: { data: PageData } = $props();
|
||||
</script>
|
||||
|
||||
<h1>bknd + SvelteKit Example</h1>
|
||||
<h1>userbase + SvelteKit Example</h1>
|
||||
|
||||
<h2>Todos</h2>
|
||||
<ul>
|
||||
|
||||
Reference in New Issue
Block a user