mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
added db for astro
This commit is contained in:
@@ -7,6 +7,8 @@
|
|||||||
"start": "astro dev",
|
"start": "astro dev",
|
||||||
"build": "astro check && astro build",
|
"build": "astro check && astro build",
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
|
"db": "turso dev --db-file test.db",
|
||||||
|
"db:check": "sqlite3 test.db \"PRAGMA wal_checkpoint(FULL);\"",
|
||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ const user = api.getUser();
|
|||||||
|
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
<Admin withProvider={{ user }} config={{ basepath: "/admin" }} client:load />
|
<Admin
|
||||||
|
withProvider={{ user }}
|
||||||
|
config={{ basepath: "/admin" }}
|
||||||
|
client:load
|
||||||
|
/>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -3,16 +3,19 @@ import { App } from "bknd";
|
|||||||
|
|
||||||
export const prerender = false;
|
export const prerender = false;
|
||||||
|
|
||||||
|
let app: App;
|
||||||
export const ALL: APIRoute = async ({ request }) => {
|
export const ALL: APIRoute = async ({ request }) => {
|
||||||
const app = App.create({
|
if (!app) {
|
||||||
connection: {
|
app = App.create({
|
||||||
type: "libsql",
|
connection: {
|
||||||
config: {
|
type: "libsql",
|
||||||
url: "http://127.0.0.1:8080"
|
config: {
|
||||||
|
url: "http://127.0.0.1:8080"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
|
||||||
await app.build();
|
await app.build();
|
||||||
|
}
|
||||||
return app.fetch(request);
|
return app.fetch(request);
|
||||||
};
|
};
|
||||||
|
|||||||
BIN
examples/astro/test.db
Normal file
BIN
examples/astro/test.db
Normal file
Binary file not shown.
Reference in New Issue
Block a user