Workers, Workers for Platforms - Fixed and documented Workers Routes and Secrets API
1y ago
Source
CloudflareWorkers, Workers for Platforms - Fixed and documented Workers Routes and Secrets APIcloudflare.comWorkers Routes API Previously, a request to the Workers Create Route API always returned null for "script" and an empty string for "pattern" even if the request was successful. curl $CF_ACCOUNT_ID /workers/routes \ -X PUT \ -H "Authorization: Bearer $CF_API_TOKEN " \ -H 'Content-Type: application/json' \ --data '{ "pattern": "example.com/*", "script": "hello-world-script" }' { " result " : { " id " : "bf153a27ba2b464bb9f04dcf75de1ef9" , " pattern " : "" , " script " : null , " request_limit_fail_open " : false }, " success " : true , " errors " : [], " messages " : [] } Now, it properly returns all values! { " result " : { " id " : "bf153a27ba2b464bb9f04dcf75de1ef9" , " pattern " : "example.com/*" , " script " : "hello-world-script" , " request_limit_fail_open " : false }, " success " : true , " errors " : [], " messages " : [] } Workers Secrets API The Workers and Workers for Platforms secrets APIs are now properly documented in the Cloudflare OpenAPI docs. Previously, these endpoints were not publicly documented, leaving users confused on how to directly manage their secrets via the API. Now, you can find the proper endpoints in our public documentation, as well as in our API Library SDKs such as cloudflare-typescript (>4.2.0) and cloudflare-python (>4.1.0). Note the cloudflare_workers_secret and cloudflare_workers_for_platforms_script_secret Terraform resources are being removed in a future release. This resource is not recommended for managing secrets. Users should instead use the: Secrets Store with the "Secrets Store Secret" binding on Workers and Workers for Platforms Script Upload "Secret Text" Binding on Workers Script Upload and Workers for Platforms Script Upload Workers (and WFP) Secrets API
You might also wanna read
Cloudflare expands AI bot management tools with granular traffic controls for all customers
Cloudflare is celebrating the second "Content Independence Day" by expanding AI traffic management options for all website owners. Building
Workers - Simpler runtime types with @cloudflare/workers-types v5
Cloudflare·1d ago
AI Search - Manage AI Search sync jobs with Wrangler CLI
Cloudflare·2d ago
Workers - Work across multiple accounts with Wrangler auth profiles
Cloudflare·2d ago
Cache - Cache multiple versions of a URL with Vary
Cloudflare·2d ago
Cloudflare One - Hostname routing for Cloudflare Mesh
Cloudflare·2d ago

Comments
Sign in to join the conversation.
No comments yet. Be the first.