From 7c0bf23c6d2d2cbfba3d5901357f48d8a6284b08 Mon Sep 17 00:00:00 2001 From: sor4chi Date: Sun, 3 Dec 2023 20:01:29 +0900 Subject: [PATCH] chore: changeset --- .changeset/clean-seals-flash.md | 19 +++++++++++++++++++ examples/batcher/wrangler.toml | 6 ++++++ 2 files changed, 25 insertions(+) create mode 100644 .changeset/clean-seals-flash.md diff --git a/.changeset/clean-seals-flash.md b/.changeset/clean-seals-flash.md new file mode 100644 index 00000000..7a91750f --- /dev/null +++ b/.changeset/clean-seals-flash.md @@ -0,0 +1,19 @@ +--- +"hono-do": minor +--- + +feat: enable to get bindings env from vars + +```ts +import { generateHonoObject } from "hono-do"; + +type Env = { + Bindings: { + KV: KVNamespace + }; +} + +export const Batcher = generateHonoObject("/", async (app, state, vars) => { + vars.env.KV // KVNamespace +}) +``` diff --git a/examples/batcher/wrangler.toml b/examples/batcher/wrangler.toml index e9995d7e..74357736 100644 --- a/examples/batcher/wrangler.toml +++ b/examples/batcher/wrangler.toml @@ -7,3 +7,9 @@ bindings = [{ name = "BATCHER", class_name = "Batcher" }] [[migrations]] tag = "v1" new_classes = ["Batcher"] + +[[d1_databases]] +binding = "DB" +database_name = "batch-db" +database_id = "ae9d3bb9-d843-4fab-9387-7aed0ad5b92b" +preview_database_id = "DB"