fix: pass CONFIG_KV binding to handlePut, add custom domain config

This commit is contained in:
团子 2026-04-20 14:02:58 +00:00
parent 4c6271a21a
commit 7ea436be34
3 changed files with 7 additions and 2 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.wrangler/

View File

@ -158,7 +158,7 @@ export default {
case "GET": case "GET":
return handleGet(key, auth, env.CONFIG_KV); return handleGet(key, auth, env.CONFIG_KV);
case "PUT": case "PUT":
return handlePut(key, scope, auth, env, request); return handlePut(key, scope, auth, env.CONFIG_KV, request);
case "DELETE": case "DELETE":
return handleDelete(key, scope, auth, env.CONFIG_KV); return handleDelete(key, scope, auth, env.CONFIG_KV);
default: default:

View File

@ -2,6 +2,10 @@ name = "config-service"
main = "src/index.ts" main = "src/index.ts"
compatibility_date = "2024-12-01" compatibility_date = "2024-12-01"
routes = [
{ pattern = "config.shazhou.work", custom_domain = true }
]
[[kv_namespaces]] [[kv_namespaces]]
binding = "CONFIG_KV" binding = "CONFIG_KV"
id = "" id = "1562fdaaafce42e98ee715d0f9e7441a"