Skip to main content

Static Unit

@klotho::static_unit

Specified anywhere within a file.

For more information about static units, visit our static unit concept page.

Directives

DirectiveTypeDescription
idstring(Required) The name of the execution unit. Files with the same execution unit name are guaranteed to stay together.
index_documentstring(Optional) The index document specifies a root file if hosting a static website. By setting the index document field, klotho understands the static unit, to be a static hosted website.
static_filesstring[](Optional) A list of files which belong solely to the static unit. Glob patterns (* and **) are supported.
shared_filesstring[](Optional) A list of files which belong to both the static unit and other units. Glob patterns (* and **) are supported.
note

The shared_files directive takes precedence over the static_files directive. If a file matches both the static_files and shared_files patterns, it will be considered a shared file.

All paths specified in the static_files and shared_files directive must be an absolute path, from the klotho compilation root, or a relative path from the file where the annotation lives.

Examples

/*
* @klotho::static_unit {
* id = "static-unit"
* index_document = "index.html"
* static_files = ["js/*"]
* shared_files = ["serve.js"]
* }
*/

Configuration

For more information about configuring static units, visit our static unit configuration page.