mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
public commit
This commit is contained in:
22
examples/cloudflare-worker/src/index.ts
Normal file
22
examples/cloudflare-worker/src/index.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { serve } from "bknd/adapter/cloudflare";
|
||||
|
||||
import manifest from "__STATIC_CONTENT_MANIFEST";
|
||||
|
||||
export default serve(
|
||||
{
|
||||
app: (env: Env) => ({
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: env.DB_URL,
|
||||
authToken: env.DB_TOKEN
|
||||
}
|
||||
}
|
||||
}),
|
||||
onBuilt: async (app) => {
|
||||
app.modules.server.get("/", (c) => c.json({ hello: "world" }));
|
||||
},
|
||||
setAdminHtml: true
|
||||
},
|
||||
manifest
|
||||
);
|
||||
Reference in New Issue
Block a user