added db for astro

This commit is contained in:
dswbx
2024-11-28 11:22:02 +01:00
parent bdc6eb55bf
commit 4693be5615
4 changed files with 18 additions and 9 deletions

View File

@@ -3,16 +3,19 @@ import { App } from "bknd";
export const prerender = false;
let app: App;
export const ALL: APIRoute = async ({ request }) => {
const app = App.create({
connection: {
type: "libsql",
config: {
url: "http://127.0.0.1:8080"
if (!app) {
app = App.create({
connection: {
type: "libsql",
config: {
url: "http://127.0.0.1:8080"
}
}
}
});
});
await app.build();
await app.build();
}
return app.fetch(request);
};