mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
16 lines
447 B
TypeScript
16 lines
447 B
TypeScript
import { type D1Connection, serve } from "bknd/adapter/cloudflare";
|
|
|
|
export default serve({
|
|
mode: "warm",
|
|
d1: {
|
|
session: true,
|
|
},
|
|
onBuilt: async (app) => {
|
|
app.modules.server.get("/custom", async (c) => {
|
|
const conn = c.var.app.em.connection as D1Connection;
|
|
const res = await conn.client.prepare("select * from __bknd limit 1").all();
|
|
return c.json({ hello: "world", res });
|
|
});
|
|
},
|
|
});
|