Skip to content

Type Alias: StaticUIOptions ​

StaticUIOptions = object

The options of staticUI.

Properties ​

assetsMaxAge? ​

optional assetsMaxAge?: string | number

How long the browsers may cache the files with a content hash in their name (the assets of a Vite build: index-B2x9fQ1a.js): a number of seconds, or a duration ('30d', '12h'; a string of digits is seconds). A file counts as hashed when it is a script, a style, a font or an image whose name ends with a dot or a dash followed by at least 8 letters, digits, _ or -, among them a digit or an uppercase letter, before its extension (index-B2x9fQ1a.js, main.3f2a1b9c.css, not my-component.js). The other files and the index are sent with Cache-Control: no-cache.

Default ​

ts
31536000 (one year)

index? ​

optional index?: string

The index file of the application, relative to the directory.

Default ​

ts
'index.html'

spa? ​

optional spa?: boolean

Serve a single-page application: a GET or HEAD request accepting HTML, whose path has no file extension and matches no file, is answered with the index (the client-side router handles the path). With false, such a request is passed on (a 404 behind expressHTTPEntrypoint).

Default ​

ts
true

Released under the MIT License.