mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 12:37:20 +00:00
added fully working astro example
This commit is contained in:
18
examples/astro/src/pages/admin/[...admin].astro
Normal file
18
examples/astro/src/pages/admin/[...admin].astro
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
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
|
||||
});
|
||||
const user = api.getUser();
|
||||
---
|
||||
|
||||
<html>
|
||||
<body>
|
||||
<Admin withProvider={{ user }} client:load />
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user