mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 20:37:21 +00:00
added fully working astro example
This commit is contained in:
18
examples/astro/src/pages/api/[...api].ts
Normal file
18
examples/astro/src/pages/api/[...api].ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { APIRoute } from "astro";
|
||||
import { App } from "bknd";
|
||||
|
||||
export const prerender = false;
|
||||
|
||||
export const ALL: APIRoute = async ({ request }) => {
|
||||
const app = App.create({
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: "http://127.0.0.1:8080"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
await app.build();
|
||||
return app.fetch(request);
|
||||
};
|
||||
Reference in New Issue
Block a user