Skip to main content

assets_block

Function assets_block 

Source
pub fn assets_block() -> TomlBlock
Expand description

#1883, slice 1b: the [assets] block for a Worker that ships static files. directory is the Worker’s own assets directory (crate::emit_model::WORKER_ASSETS_DIR), beside — never containing — its compiled code. The three routing settings are set explicitly rather than inherited (#1883 [DECISION C], checked against the wrangler reference):

  • run_worker_first = false: a matching asset is served without running the Worker, which is what makes an asset public by construction.
  • not_found_handling = "none": a request no asset matches falls through to the Worker, so every handler stays reachable.
  • html_handling = "none": an asset is served only at its exact path (the default would also serve foo.html at /foo), so the route-conflict check can compare paths exactly.