Skip to content

Conversation

WalshyDev
Copy link
Member

Summary

Documents mounting assets on a given path and the behaviour of it.

Note: Waiting on Wrangler to go out

Screenshots (optional)

image

Documentation checklist

  • The documentation style guide has been adhered to.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.
  • Files which have changed name or location have been allocated redirects.

Copy link

cloudflare-workers-and-pages bot commented Dec 10, 2024

Deploying cloudflare-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: b88b6e0
Status: ✅  Deploy successful!
Preview URL: https://7da55866.cloudflare-docs-7ou.pages.dev
Branch Preview URL: https://walshy-mounted-assets.cloudflare-docs-7ou.pages.dev

View logs

Copy link
Contributor

@irvinebroque irvinebroque left a comment

Choose a reason for hiding this comment

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

interesting that this is something that also wasn't possible with Pages - right?

I can have a custom domain with a Pages project.

But I can't define a route to say — run the Pages project at /blog.

And so here, I can just run the Worker, and its assets at /blog — that was already possible.

But before — if I had /blog directory, and ran the Worker on the /blog route, to access /dist/blog/index.html I would have to go to example.com/blog/blog

And now just example.com/blog

Is that accurate before/after?

@irvinebroque
Copy link
Contributor

irvinebroque commented Dec 10, 2024

Or did we just disallow mounting assets on a route before

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, 1 total issue(s) found.

@WalshyDev WalshyDev force-pushed the walshy/mounted-assets branch from fc45612 to 50612e7 Compare December 12, 2024 12:57
@WalshyDev WalshyDev force-pushed the walshy/mounted-assets branch from 50612e7 to b88b6e0 Compare December 20, 2024 18:06
@WalshyDev WalshyDev marked this pull request as ready for review December 20, 2024 18:07
@WalshyDev WalshyDev requested review from a team and ToriLindsay as code owners December 20, 2024 18:07
Copy link
Contributor

@korinne korinne left a comment

Choose a reason for hiding this comment

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

Looks great, thanks so much!

@WalshyDev WalshyDev merged commit 6a5e1e1 into production Dec 20, 2024
12 checks passed
@WalshyDev WalshyDev deleted the walshy/mounted-assets branch December 20, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:workers Related to Workers product size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.