cloudflare / cloudflare-docs

Cloudflare’s documentation
https://developers.cloudflare.com
Creative Commons Attribution 4.0 International
2.93k stars 3.42k forks source link

updates on the upload worker module with concrete example #9402

Closed gillbates closed 4 months ago

gillbates commented 1 year ago

Which Cloudflare product does this pertain to?

Workers

Existing documentation URL(s)

https://developers.cloudflare.com/api/operations/worker-script-upload-worker-module

Section that requires update

curl --request PUT \ --url https://api.cloudflare.com/client/v4/accounts/account_identifier/workers/scripts/script_name \ --header 'Content-Type: multipart/form-data' \ --header 'X-Auth-Email: ' \ --form '"message"=' \ --form '"second-file.js"=' \ --form '"worker.js"=' \ --form metadata=

What needs to change?

I wonder if the team could provide a sample upload curl with all info from a wrangler.toml

name = "r2worker"
main = "src/worker.js"
compatibility_date = "2023-06-16"
account_id = "xxxx" 
workers_dev = true

# # Bucket binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/kv#bucket
[[r2_buckets]]
binding = "BUCKET"
bucket_name = "xxx"

How should it change?

the current curl sample would be much better if the values are written their with some fake data?

Additional information

No response

kodster28 commented 4 months ago

Howdy @gillbates, technically the ownership of those API endpoints (and examples is the ENG team) and out of scope for this repo.

I've passed this along internally to that team. Closing out this issue as that's as much as we can do w/in the context of the current repo.