WorkerScriptAssetsConfig

data class WorkerScriptAssetsConfig(val _headers: String? = null, val _redirects: String? = null, val htmlHandling: String? = null, val notFoundHandling: String? = null, val runWorkerFirst: Boolean? = null, val serveDirectly: Boolean? = null)

Constructors

Link copied to clipboard
constructor(_headers: String? = null, _redirects: String? = null, htmlHandling: String? = null, notFoundHandling: String? = null, runWorkerFirst: Boolean? = null, serveDirectly: Boolean? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val _headers: String? = null

The contents of a _headers file (used to attach custom headers on asset responses)

Link copied to clipboard
val _redirects: String? = null

The contents of a _redirects file (used to apply redirects or proxy paths ahead of asset serving)

Link copied to clipboard
val htmlHandling: String? = null

Determines the redirects and rewrites of requests for HTML content. Available values: "auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none".

Link copied to clipboard

Determines the response when a request does not match a static asset, and there is no Worker script. Available values: "none", "404-page", "single-page-application".

Link copied to clipboard
val runWorkerFirst: Boolean? = null

When true, requests will always invoke the Worker script. Otherwise, attempt to serve an asset matching the request, falling back to the Worker script.

Link copied to clipboard
val serveDirectly: Boolean? = null

When true and the incoming request matches an asset, that will be served instead of invoking the Worker script. When false, requests will always invoke the Worker script.