From bdf760a3c3525f9f729f7fd9110956cecda13f68 Mon Sep 17 00:00:00 2001 From: jeff Date: Sat, 12 Oct 2024 14:57:17 +0800 Subject: [PATCH] fix: db config --- src/views/helloworld/index.vue | 1 + wrangler.toml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/views/helloworld/index.vue b/src/views/helloworld/index.vue index 58a3e8f..178defa 100644 --- a/src/views/helloworld/index.vue +++ b/src/views/helloworld/index.vue @@ -6,6 +6,7 @@ const data = ref(""); onMounted(async () => { const response = await fetch(`/api/hello-world`); data.value = await response.text(); + // await fetch(`/api/user/detail?id=1`); }); diff --git a/wrangler.toml b/wrangler.toml index 48f4bd0..3859da8 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -1,3 +1,8 @@ name = "cloudflare-pages-demo" compatibility_date = "2024-09-09" main = "app/server.ts" + +[[d1_databases]] +binding = "DB" # This is the variable name you'll use in your code +database_name = "demo" +database_id = "test"