Serve a static site or SPA with Workers Assets

deploy & domains

// what it does

Uploads a directory of static files served directly from the edge, the modern replacement for Workers Sites. Point it at your build output (./dist, ./build) to host a static site or SPA, and pair it with a Worker script when you also need API routes alongside the files.

// shell

$ wrangler deploy --assets ./dist

// gotcha

Assets require a compatibility date to be set, and when a Worker script coexists with assets the static files are matched first — configure assets.not_found_handling for SPA fallback or client-side routes will 404.