## CLI interface Usage: ```bash $ error-pages [GLOBAL FLAGS] [COMMAND] [COMMAND FLAGS] [ARGUMENTS...] ``` Global flags: | Name | Description | Default value | Environment variables | |--------------------|---------------------------------------|:-------------:|:---------------------:| | `--log-level="…"` | logging level (debug/info/warn/error) | `info` | `LOG_LEVEL` | | `--log-format="…"` | logging format (console/json) | `console` | `LOG_FORMAT` | ### `serve` command (aliases: `s`, `server`, `http`) Start HTTP server. Usage: ```bash $ error-pages [GLOBAL FLAGS] serve [COMMAND FLAGS] [ARGUMENTS...] ``` The following flags are supported: | Name | Description | Default value | Environment variables | |------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------:|:---------------------------:| | `--listen="…"` (`-l`) | IP (v4 or v6) address to listen on | `0.0.0.0` | `LISTEN_ADDR` | | `--port="…"` (`-p`) | TCP port number | `8080` | `LISTEN_PORT` | | `--add-template="…"` | to add a new template, provide the path to the file using this flag (the filename without the extension will be used as the template name) | `[]` | *none* | | `--disable-template="…"` | disable the specified template by its name | `[]` | *none* | | `--add-http-code="…"` | to add a new HTTP status code, provide the code and its message/description using this flag (the format should be '%code%=%message%/%description%'; the code may contain a wildcard '*' to cover multiple codes at once, for example, '4**' will cover all 4xx codes, unless a more specific code was described previously) | `map[]` | *none* | | `--json-format="…"` | override the default error page response in JSON format (Go templates are supported) | | `RESPONSE_JSON_FORMAT` | | `--xml-format="…"` | override the default error page response in XML format (Go templates are supported) | | `RESPONSE_XML_FORMAT` | | `--plaintext-format="…"` | override the default error page response in plain text format (Go templates are supported) | | `RESPONSE_PLAINTEXT_FORMAT` | | `--template-name="…"` (`-t`) | name of the template to use for rendering error pages | `app-down` | `TEMPLATE_NAME` | | `--disable-l10n` | disable localization of error pages (if the template supports localization) | `false` | `DISABLE_L10N` | | `--default-error-page="…"` | the code of the default (index page, when a code is not specified) error page to render | `404` | `DEFAULT_ERROR_PAGE` | | `--send-same-http-code` | the HTTP response should have the same status code as the requested error page (by default, every response with an error page will have a status code of 200) | `false` | `SEND_SAME_HTTP_CODE` | | `--show-details` | show request details in the error page response (if supported by the template) | `false` | `SHOW_DETAILS` | | `--proxy-headers="…"` | listed here HTTP headers will be proxied from the original request to the error page response (comma-separated list) | `X-Request-Id,X-Trace-Id,X-Amzn-Trace-Id` | `PROXY_HTTP_HEADERS` | | `--rotation-mode="…"` | templates automatic rotation mode (disabled/random-on-startup/random-on-each-request/random-hourly/random-daily) | `disabled` | `TEMPLATES_ROTATION_MODE` | ### `healthcheck` command (aliases: `chk`, `health`, `check`) Health checker for the HTTP server. The use case - docker health check. Usage: ```bash $ error-pages [GLOBAL FLAGS] healthcheck [COMMAND FLAGS] [ARGUMENTS...] ``` The following flags are supported: | Name | Description | Default value | Environment variables | |---------------------|-----------------|:-------------:|:---------------------:| | `--port="…"` (`-p`) | TCP port number | `8080` | `LISTEN_PORT` |