Skip to content

Latest commit

 

History

History
366 lines (336 loc) · 7.39 KB

File metadata and controls

366 lines (336 loc) · 7.39 KB
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.

Complete Options Reference

Options define Mokapi's run behavior that can be passed in multiple places. Mokapi chooses the value from the highest order of precedence.

Log

Mokapi log level (default is info)

--log-level=warn
MOKAPI_LOG_LEVEL=warn
log:
  level: warn

Mokapi log format: json|text (default is text)

--log-format=json
MOKAPI_LOG_FORMAT=json
log:
  format: json

API & Dashboard

API port (Default 8080). The API is available on the path /api

--api-port 5000
MOKAPI_API_PORT=5000
api:
  port: 5000

Activate 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-dashboard
MOKAPI_API_DASHBOARD=true
api:
  dashboard: true

The path prefix where dashboard is served (default empty)

--api-path /mokapi/dashboard
MOKAPI_API_PATH=/mokapi/dashboard
api:
  path: /mokapi/dashboard

The base path of the dashboard useful in case of url rewriting (default empty)

--api-base /mokapi/dashboard
MOKAPI_API_BASE=/mokapi/dashboard
api:
  base: /mokapi/dashboard

File Provider

Load the dynamic configuration from file

--providers-file-filename foobar.yaml
MOKAPI_PROVIDERS_FILE_FILENAME=foobar.yaml
providers:
  file:
    filename: foobar.yaml

Load one or more dynamic configuration from a directory

--providers-file-directory /foobar
MOKAPI_PROVIDERS_FILE_DIRECTORY=/foobar
providers:
  file:
    directory: /foobar

One or more prefixes that indicate whether a file or directory should be skipped. (default is ["_"])

--providers-file-skip-prefix foo
MOKAPI_PROVIDERS_FILE_SKIP_PREFIX=foo
providers:
  file:
    skipPrefix: foo

One or more patterns that a file must match, except when empty.

--providers-file-include *.json *.yaml
MOKAPI_PROVIDERS_FILE_INCLUDE="*.json *.yaml"
providers:
  file:
    include:
      - "*.json"
      - "*.yaml"

HTTP Provider

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.yaml
providers:
  http:
    url: https://foo.bar/file.yaml
    urls:
      - https://foo.bar/file2.yaml

Polling interval for URL (default is 3m)

--providers-http-poll-interval 10s
--providers-http-poll-interval 5m
MOKAPI_PROVIDERS_HTTP_POLL_INTERVAL=10s
providers:
  http:
    pollInterval: 10s

Polling timeout for URL (default is 5s)

--providers-http-poll-timeout 10s
--providers-http-poll-timeout 5m
MOKAPI_PROVIDERS_HTTP_POLL_TIMEOUT=10s
providers:
  http:
    polTimeout: 10s

Specifies a proxy server for the request, rather than connecting directly to the URL.

--providers-http-proxy http://localhost:3128
MOKAPI_PROVIDERS_HTTP_PROXY=http://localhost:3128
providers:
  http:
    proxy: http://localhost:3128

Skip certificate validation checks.

--providers-http-tls-skip-verify true
--providers-http-tls-skip-verify
MOKAPI_PROVIDERS_HTTP_TLS_SKIP_VERIFY=true
providers:
  http:
    tlsSkipVerify: true

Path to the certificate authority used for secure connection. By default, the system certification pool is used.

--providers-http-ca /path/to/mycert.pem
MOKAPI_PROVIDERS_HTTP_CA=/path/to/mycert.pem
providers:
  http:
    ca: /path/to/mycert.pem

GIT Provider

Load one or more dynamic configuration from a GIT repository

--providers-git-url=https://github.com/foo/foo.git
MOKAPI_PROVIDERS_GIT_URL=https://github.com/foo/foo.git
providers:
  git:
    url: https://github.com/foo/foo.git

Pulling interval for URL in seconds (default 3m)

--providers-git-pull-interval=10s
MOKAPI_PROVIDERS_GIT_PULL_IINTERVAL=10s
providers:
  git:
    pullInterval: 10s

Pulling interval for URL in seconds (default 3m)

--providers-git-pul-interval=10s
MOKAPI_PROVIDERS_GIT_PULL_IINTERVAL=10s
providers:
  git:
    pullInterval: 10s

Specifies the folder to check out all GIT repositories (default uses the default directory for temporary files)

--providers-git-temp-dir=/tempdir
MOKAPI_PROVIDERS_GIT_TEMP_DIR=/tempdir
providers:
  git:
    tempDir: /tempdir

NPM Provider

Specifies NPM package that Mokapi looks for.

--providers-npm-package=foo
MOKAPI_PROVIDERS_NPM_PACKAGE=foo
providers:
  npm:
    package: foo

Certificates

CA Certificate for signing certificate generated at runtime

--rootCaCert=/path/to/caCert.pem
MOKAPI_RootCaCert=/path/to/caCert.pem
providers:
  rootCaCert: /path/to/caCert.pem

Private Key of CA for signing certificate generated at runtime

--rootCaKey=/path/to/caKey.pem
MOKAPI_RootCaKey=/path/to/caKey.pem
providers:
  rootCaKey: /path/to/caKey.pem

Events Store

Mokapi 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 200
MOKAPI_EVENT_STORE_DEFAULT=200
event:
  store:
    default: 200

Overrides the default event store size for a specific API by name.

--event-store-<name>-size 200
MOKAPI_EVENT_STORE_<NAME>=200
event:
  store:
    <name>: 200

Provides 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