| title | Complete Options Reference |
|---|---|
| description | A complete list of all Mokapi options and how to set the option in your config files, environment variables, or CLI. |
Options define Mokapi's run behavior that can be passed in multiple places. Mokapi chooses the value from the highest order of precedence.
Mokapi log level (default is info)
--log-level=warnMOKAPI_LOG_LEVEL=warnlog:
level: warnMokapi log format: json|text (default is text)
--log-format=jsonMOKAPI_LOG_FORMAT=jsonlog:
format: jsonAPI port (Default 8080). The API is available on the path /api
--api-port 5000MOKAPI_API_PORT=5000api:
port: 5000Activate dashboard (default true). The dashboard is available at the same port as the API but on the path / by default.
--api-dashboard true
--api-dashboard
--api-no-dashboardMOKAPI_API_DASHBOARD=trueapi:
dashboard: trueThe path prefix where dashboard is served (default empty)
--api-path /mokapi/dashboardMOKAPI_API_PATH=/mokapi/dashboardapi:
path: /mokapi/dashboardThe base path of the dashboard useful in case of url rewriting (default empty)
--api-base /mokapi/dashboardMOKAPI_API_BASE=/mokapi/dashboardapi:
base: /mokapi/dashboardLoad the dynamic configuration from file
--providers-file-filename foobar.yamlMOKAPI_PROVIDERS_FILE_FILENAME=foobar.yamlproviders:
file:
filename: foobar.yamlLoad one or more dynamic configuration from a directory
--providers-file-directory /foobarMOKAPI_PROVIDERS_FILE_DIRECTORY=/foobarproviders:
file:
directory: /foobarOne or more prefixes that indicate whether a file or directory should be skipped. (default is ["_"])
--providers-file-skip-prefix fooMOKAPI_PROVIDERS_FILE_SKIP_PREFIX=fooproviders:
file:
skipPrefix: fooOne or more patterns that a file must match, except when empty.
--providers-file-include *.json *.yamlMOKAPI_PROVIDERS_FILE_INCLUDE="*.json *.yaml"providers:
file:
include:
- "*.json"
- "*.yaml"Load configuration from this URL
--providers-http-url https://foo.bar/file.yaml
--providers-http-url https://foo.bar/file1.yaml --providers-http-url https://foo.bar/file2.yaml
--providers-http-urls https://foo.bar/file1.yaml https://foo.bar/file2.yaml
--providers-http-urls '["https://foo.bar/file1.yaml","https://foo.bar/file2.yaml"]'MOKAPI_PROVIDERS_HTTP_URL=https://foo.bar/file.yamlproviders:
http:
url: https://foo.bar/file.yaml
urls:
- https://foo.bar/file2.yamlPolling interval for URL (default is 3m)
--providers-http-poll-interval 10s
--providers-http-poll-interval 5mMOKAPI_PROVIDERS_HTTP_POLL_INTERVAL=10sproviders:
http:
pollInterval: 10sPolling timeout for URL (default is 5s)
--providers-http-poll-timeout 10s
--providers-http-poll-timeout 5mMOKAPI_PROVIDERS_HTTP_POLL_TIMEOUT=10sproviders:
http:
polTimeout: 10sSpecifies a proxy server for the request, rather than connecting directly to the URL.
--providers-http-proxy http://localhost:3128MOKAPI_PROVIDERS_HTTP_PROXY=http://localhost:3128providers:
http:
proxy: http://localhost:3128Skip certificate validation checks.
--providers-http-tls-skip-verify true
--providers-http-tls-skip-verifyMOKAPI_PROVIDERS_HTTP_TLS_SKIP_VERIFY=trueproviders:
http:
tlsSkipVerify: truePath to the certificate authority used for secure connection. By default, the system certification pool is used.
--providers-http-ca /path/to/mycert.pemMOKAPI_PROVIDERS_HTTP_CA=/path/to/mycert.pemproviders:
http:
ca: /path/to/mycert.pemLoad one or more dynamic configuration from a GIT repository
--providers-git-url=https://github.com/foo/foo.gitMOKAPI_PROVIDERS_GIT_URL=https://github.com/foo/foo.gitproviders:
git:
url: https://github.com/foo/foo.gitPulling interval for URL in seconds (default 3m)
--providers-git-pull-interval=10sMOKAPI_PROVIDERS_GIT_PULL_IINTERVAL=10sproviders:
git:
pullInterval: 10sPulling interval for URL in seconds (default 3m)
--providers-git-pul-interval=10sMOKAPI_PROVIDERS_GIT_PULL_IINTERVAL=10sproviders:
git:
pullInterval: 10sSpecifies the folder to check out all GIT repositories (default uses the default directory for temporary files)
--providers-git-temp-dir=/tempdirMOKAPI_PROVIDERS_GIT_TEMP_DIR=/tempdirproviders:
git:
tempDir: /tempdirSpecifies NPM package that Mokapi looks for.
--providers-npm-package=fooMOKAPI_PROVIDERS_NPM_PACKAGE=fooproviders:
npm:
package: fooCA Certificate for signing certificate generated at runtime
--rootCaCert=/path/to/caCert.pemMOKAPI_RootCaCert=/path/to/caCert.pemproviders:
rootCaCert: /path/to/caCert.pemPrivate Key of CA for signing certificate generated at runtime
--rootCaKey=/path/to/caKey.pemMOKAPI_RootCaKey=/path/to/caKey.pemproviders:
rootCaKey: /path/to/caKey.pemMokapi stores request and event history in memory. You can control the memory size (in number of events) for each event store using the following CLI flags.
Sets the default maximum number of events stored for each event type (e.g., HTTP, Kafka), unless overridden individually. (default 100)
--event-store-default-size 200MOKAPI_EVENT_STORE_DEFAULT=200event:
store:
default: 200Overrides the default event store size for a specific API by name.
--event-store-<name>-size 200MOKAPI_EVENT_STORE_<NAME>=200event:
store:
<name>: 200Provides advanced configuration for a specific API using a JSON-style syntax. This format is required if the API name contains spaces or special characters.
--event-store <api-name>={"size": 250}MOKAPI_EVENT_STORE=<api-name>={"size": 250}event:
store:
"<api-name>": 250