mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
adding d1 for cloudflare environments
This commit is contained in:
@@ -11,7 +11,8 @@
|
||||
"cf-typegen": "wrangler types"
|
||||
},
|
||||
"dependencies": {
|
||||
"bknd": "workspace:*"
|
||||
"bknd": "workspace:*",
|
||||
"kysely-d1": "^0.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20241106.0",
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
/// <reference types="@cloudflare/workers-types" />
|
||||
|
||||
import { serve } from "bknd/adapter/cloudflare";
|
||||
|
||||
export default serve({
|
||||
app: (args) => ({
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: "http://localhost:8080"
|
||||
}
|
||||
}
|
||||
}),
|
||||
onBuilt: async (app) => {
|
||||
app.modules.server.get("/custom", (c) => c.json({ hello: "world" }));
|
||||
}
|
||||
});
|
||||
export default serve();
|
||||
|
||||
@@ -10,5 +10,7 @@ assets = { directory = "../../app/dist/static" }
|
||||
[observability]
|
||||
enabled = true
|
||||
|
||||
#[site]
|
||||
#bucket = "../../app/dist/static"
|
||||
[[d1_databases]]
|
||||
binding = "DB"
|
||||
database_name = "bknd-cf-example"
|
||||
database_id = "7ad67953-2bbf-47fc-8696-f4517dbfe674"
|
||||
Reference in New Issue
Block a user