misc: add nodejs_compat for workers, workers can use secrets from env now

pull/169/head
lyc8503 2025-12-23 23:31:02 +08:00
parent e9d8a1c842
commit baf489e3cb
3 changed files with 3 additions and 0 deletions

View File

@ -27,6 +27,7 @@ resource "cloudflare_worker_script" "uptimeflare" {
content = file("worker/dist/index.js")
module = true
compatibility_date = "2025-04-02"
compatibility_flags = ["nodejs_compat"]
kv_namespace_binding {
name = "UPTIMEFLARE_STATE"

View File

@ -2,3 +2,4 @@ name = "uptimeflare_worker"
main = "src/index.ts"
compatibility_date = "2025-04-02"
kv_namespaces = [{ binding = "UPTIMEFLARE_STATE", id = "UPTIMEFLARE_STATE" }]
compatibility_flags = [ "nodejs_comat" ]

View File

@ -1,3 +1,4 @@
name = "uptimeflare_worker"
main = "src/index.ts"
compatibility_date = "2025-04-02"
compatibility_flags = [ "nodejs_comat" ]