added minimal astro adapter + improved the example

This commit is contained in:
dswbx
2024-11-29 21:21:59 +01:00
parent 6eb0d2242f
commit 582dbd4272
11 changed files with 301 additions and 35 deletions

View File

@@ -1,21 +1,20 @@
---
import { Api } from "bknd";
import { Admin } from "bknd/ui";
import "bknd/dist/styles.css";
export const prerender = false;
const api = new Api({
host: new URL(Astro.request.url).origin,
headers: Astro.request.headers
});
import { getApi } from "bknd/adapter/astro";
const api = getApi(Astro, { mode: "dynamic" });
const user = api.getUser();
export const prerender = false;
---
<html>
<body>
<Admin
withProvider={{ user }}
config={{ basepath: "/admin" }}
config={{ basepath: "/admin", color_scheme: "dark" }}
client:load
/>
</body>