CoshmarBlondasekZDużymMieczem
CoshmarBlondasekZDużymMieczem
CDCloudflare Developers
Created by CoshmarBlondasekZDużymMieczem on 12/23/2024 in #workers-help
Static Asset - Override Headers
Hi all, I have a scenario in which I want to host part of the website from Cloudflare Static Assets, part from origin server. Additionally for a scenario in which I serve static html pages from Cloudflare Static Assets, I want to dynamically set http headers based on some query parameters. I see 2 issues here: 1) If Static Assets is serving file, I can's see my worker logs via Cloudflare Dashboard, 2) It seems that I am unable to modify headers of the response from await env.ASSETS.fetch(path) Am I missing something? Or is this a limitation?
6 replies
CDCloudflare Developers
Created by CoshmarBlondasekZDużymMieczem on 12/23/2024 in #workers-help
Static Assets on zone with domain wildcard
Hi all, When I try to deploy my worker, I have an error:
Workers which have static assets cannot be routed on a URL which has a path component. Update the route to replace //<domain>/* with /*
My use case is - I want to have a worker, bound to a single domain, where in some scenarios I want to serve static site. Does it mean that Static Assets is a no-go in this scenario?
4 replies
CDCloudflare Developers
Created by CoshmarBlondasekZDużymMieczem on 12/3/2024 in #general-help
Key-Value bindings not visible in Cloudflare Dashboard
Hi guys, I have a problem, in which I have a wrangler.toml config:
kv_namespaces = [ { binding = "kv", id = "XYZ", preview_id = "XYZ" }, ] durable_objects.bindings = [ { name = "CONFIGURATION", class_name = "SomeStore" }, ]
And then in the code I am reading / writing values from key value binding. Write operation:
await env.kv.put("SOME_PROP", {"SOME_PROP": "SOME_VAUE"});
Later I am able to read this value:
const id = env.CONFIGURATION.idFromName('SOME_PROP'); return env.CONFIGURATION.get(id); await this.env.kv.get(key)
But here is the question -> why is this value ({"SOME_PROP": "SOME_VAUE"}) not visible in the Cloudflare Dashboard -> Workers & Pages -> KV -> (my namespace by id) -> KV Pairs?
3 replies