chore(worker): wire up real KV ID + workers_dev=true + harden getNextRef

- wrangler.toml: workers_dev=true (= explicit routing on *.workers.dev)
- wrangler.toml: real KV ID c02656ba2206... after `wrangler kv namespace create WELCOME_KV`
- hubspot-proxy.js getNextRef: guard `!res.ok` before res.json() to surface HubSpot errors
- .gitignore: ignore .wrangler/ local cache dir

Discovered during Phase D2-D3 deploy + smoke testing.

Refs: WordPress \xe2\x86\x92 static migration plan, Phase B PR #3a.
This commit is contained in:
Serge RAKOTO HARRY-NAIVO 2026-05-07 14:25:25 +02:00
parent e4b4992e67
commit c27a9ea805
3 changed files with 6 additions and 1 deletions

1
cloudflare-worker/.gitignore vendored Normal file
View File

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

View File

@ -297,6 +297,9 @@ async function getNextRef(token) {
limit: 100, limit: 100,
}), }),
}); });
if (!res.ok) {
throw new Error(`HubSpot search failed: ${res.status}`);
}
const data = await res.json(); const data = await res.json();
let maxNum = 0; let maxNum = 0;
(data.results || []).forEach(c => { (data.results || []).forEach(c => {

View File

@ -1,11 +1,12 @@
name = "mva-hubspot-proxy" name = "mva-hubspot-proxy"
main = "hubspot-proxy.js" main = "hubspot-proxy.js"
compatibility_date = "2026-04-01" compatibility_date = "2026-04-01"
workers_dev = true
# KV namespace — placeholder ID, populated at deploy time (Phase D3) # KV namespace — placeholder ID, populated at deploy time (Phase D3)
[[kv_namespaces]] [[kv_namespaces]]
binding = "WELCOME_KV" binding = "WELCOME_KV"
id = "REPLACE_AT_DEPLOY_TIME" id = "c02656ba22064923ab1c6db06b0f4a56"
# Required secrets to configure via `wrangler secret put` : # Required secrets to configure via `wrangler secret put` :
# - HUBSPOT_TOKEN # - HUBSPOT_TOKEN