mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 12:56:05 +00:00
added fully working astro example
This commit is contained in:
16
examples/astro/src/pages/index.astro
Normal file
16
examples/astro/src/pages/index.astro
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
import { Api } from "bknd";
|
||||
const api = new Api({
|
||||
host: new URL(Astro.request.url).origin
|
||||
});
|
||||
const { data } = await api.data.readMany("todos");
|
||||
---
|
||||
|
||||
|
||||
<h1>Home (static)</h1>
|
||||
<h2>Data</h2>
|
||||
<pre>{JSON.stringify(data, null, 2)}</pre>
|
||||
|
||||
<a href="/admin">Admin</a> -
|
||||
<a href="/ssr">SSR (with auth)</a> -
|
||||
<a href="/">Home (static)</a>
|
||||
Reference in New Issue
Block a user