## 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/fatal) | `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* | | `--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` | | `--template-name="…"` (`-t`) | name of the template to use for rendering error pages | `template-1` | `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` | | `--default-http-code="…"` | the default (index page, when a code is not specified) HTTP response code | `404` | `DEFAULT_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` | | `--read-buffer-size="…"` | customize the HTTP read buffer size (set per connection for reading requests, also limits the maximum header size; consider increasing it if your clients send multi-KB request URIs or multi-KB headers, such as large cookies) | `0` | `READ_BUFFER_SIZE` | ### `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` |