Executables are run at request time, with standard output piped out as the response body. Any
program that you can run from the command line will work (scripts, compiled programs, etc). The executable is
invoked with no CLI arguments and with its working directory set to its own parent folder.
An environment variable named OPERATOR_RENDER_DATA
is provided to executables. Its value is
render data
encoded as JSON. This is the same data provided to handlebars templates.
Executables have two extensions, with the first one indicating the media type of the executable's output
(contact.html.py
, styles.css.sh
, dankmeme.jpg.exe
, etc). Operator
requires execute permissions on these files, and scripts will typically need a
shebang
so your OS knows how to interpret them.
Operator doesn't care what the second extension is for executables, but you can use it to indicate the file
type—for example, contact.html.py
would be a Python script which outputs HTML. In
executables the file type is usually not the same as its output type, although if you're
feeling feisty then things like
wat.js.js
are certainly possible.