Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workers for Platforms: Static assets docs #19527

Merged

Conversation

dinasaur404
Copy link
Contributor

Summary

Adding documentation around how Workers for Platforms customers can use Static Assets. This includes instructions for uploading static assets using the API & Wrangler.

Documentation checklist

@dinasaur404 dinasaur404 requested a review from a team as a code owner January 29, 2025 17:12
@dinasaur404 dinasaur404 changed the title Static assets docs Workers for Platforms: Static assets docs Jan 29, 2025
Copy link
Contributor

@hyperlint-ai hyperlint-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 files reviewed, 4 total issue(s) found.

dinasaur404 and others added 4 commits January 29, 2025 12:14
…s/configuration/static-assets.mdx

Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
…s/configuration/static-assets.mdx

Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
…s/configuration/static-assets.mdx

Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
…s/configuration/static-assets.mdx

Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
---
Workers for Platforms lets you deploy front-end applications at scale. By hosting static assets on Cloudflare's global network, you can deliver faster load times worldwide and eliminate the need for external infrastructure. You can also combine these static assets with dynamic logic in Cloudflare Workers, providing a full-stack experience for your customers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think helpful to link to workers docs around static assets to connect dots that this is fundamentally same thing

Your applications scale automatically to handle high traffic without requiring you to provision or manage infrastructure. Cloudflare dynamically adjusts to demand in real time.

#### Unified deployment for static and dynamic content
Deploy front-end assets alongside server-side logic, all within Cloudflare Workers. This eliminates the need for a separate hosting provider and ensures a streamlined deployment process.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ this stuff + above — find way to make it topline here

https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/

or in platform section of WFP docs

think in config section - get straight to the chase and show vs tell

}
```

To start the upload process, send a POST request to the Create Assets Upload Session [API endpoint](/api/resources/workers_for_platforms/subresources/dispatch/subresources/namespaces/subresources/scripts/subresources/asset_upload/methods/create/)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is using REST API directly not the SDK because SDK doesn't support it? Or another reason?

**Sample request:**

```bash
curl -X POST \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question here — SDK?


# Deploying static assets with Wrangler

If you prefer a CLI-based approach and your platform setup allows direct publishing, you can use Wrangler to deploy both your Worker code and static assets. Wrangler bundles and uploads static assets (from a specified directory) along with your Worker script, so you can manage everything in one place.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think framing this more as "you can do this to test things out"

I don't get the case where there is any WFP platform that gives the customer keys to just publish with wrangler? Something I am missing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think could just say — in this flow, works just like Workers Assets (link) — you just include these flags:

npx wrangler deploy --name <USER_WORKER_NAME> --dispatch-namespace <NAMESPACE_NAME>

Otherwise — end up repeating same thing that is in Workers Assets docs

@RebeccaTamachiro RebeccaTamachiro enabled auto-merge (squash) January 30, 2025 19:11
@RebeccaTamachiro RebeccaTamachiro merged commit 1672a33 into cloudflare:production Jan 30, 2025
6 checks passed
@workers-devprod workers-devprod added the contribution [Holopin] Recognizes a docs contribution, big or small label Jan 30, 2025
Copy link

holopin-bot bot commented Jan 30, 2025

Congratulations @dinasaur404, the maintainer of this repository has issued you a holobyte! Here it is: https://holopin.io/holobyte/cm6jpyixl67870cl2j3f9djph

This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account.
Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution [Holopin] Recognizes a docs contribution, big or small product:cloudflare-for-platforms size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants