| title | File Provider |
|---|---|
| description | The file provider reads dynamic configuration from a single file or multiple files. |
The file provider reads dynamic configuration from a single file or multiple files.
providers:
file:
directory: /path/to/dynamic/config--providers-file-directory /path/to/dynamic/configMOKAPI_PROVIDERS_FILE_DIRECTORY=/path/to/dynamic/configYou also can use CLI JSON or shorthand syntax to, see [CLI](/docs/configuration/static/cli.md)
A list of all options that can be used with the file provider, refer to the reference page.
Mokapi uses fsnotify to listen to file system notification. There
are issues with if Mokapi runs in a Linux Docker container on Windows
WSL2 host system.
Defines the path to the configuration file.
providers:
file:
filename: foobar.yaml--providers-file-filename foobar.yamlMOKAPI_PROVIDERS_FILE_FILENAME=foobar.yamlDefines the path to the directory that contains the configuration files. You can also organize your configuration files in subdirectories.
providers:
file:
directory: /foobar--providers-file-directory /foobarMOKAPI_PROVIDERS_FILE_DIRECTORY=/foobarYou can define multiple file names or directory using CLI JSON or shorthand syntax, see [CLI](/docs/configuration/static/cli.md)
You can also define multiple file names or directory by separating them with system's path separator
(Unix=':', Windows=';')
One or more patterns that a file must match, except when empty. The filter is only applied to files.
providers:
file:
include: ["*.json", "*.yaml"]--providers-file-include *.json *.yamlMOKAPI_PROVIDERS_FILE_INCLUDE="*.json *.yaml"You can create a .mokapiignore file in your directory to tell
Mokapi which files and directories to ignore. The structure of this
file follows the gitignore specification
Example to exclude everything except a specific directory foo
/*
!/foo