This chapter describes all available configuration properties and options. There are multiple methods for defining configuration and options.
When same option is defined using multiple methods, the priority is (from lower to higher):
Path as <String>Path to the folder containing behaviors and fixtures to be used by the server. By default is
<Number>Port number for the Mocks Server to be listening. Default is 3100.
<String>Host for the server. Default is "0.0.0.0" (Listen to any local host).
<String>Logs level. Can be one of "silly", "debug", "verbose", "info", "warn", "error".
<String>Watch behaviors folder and restart server on changes. Default is
falseto disable it.
<String>Default selected behavior when server is started.
<Number>Responses delay time in milliseconds.
Low level configuration
This options can't be modified while the server is running, and can be defined only using the configuration file or programmatically (if you are using directly the @mocks-server/core instead of the main distribution).
<Array of Plugins>Array of Plugins, defined as described in the plugins chapter.
<Array of Plugins>Array of Plugins to be added. This option does not overwrite previously defined plugins.
<String>Custom path for configuration file. If relative, will be resolved from current working directory. Default is
true, disables both command line arguments and configuration file.
true, command line arguments defining options will be ignored.
true, configuration file will be ignored.
Plugins extra options
Each plugin can add his own options when it is registered in the mocks-server. This options can also be defined using command line arguments and changed while the server is running.
<String>Start interactive CLI. Default is
falseto disable it.
<String>Path for the administration api. Default is "/admin". You should change it only in case there is any conflict with the api you are mocking.
<Boolean>Disables deprecated "/mocks" api path, which is still enabled by default. Used as command line argument, you can disable it using
--no-adminApiDeprecatedPaths(Read the command-line-arguments chapter for further info)
If you are starting the server programmatically using the @mocks-server/core without adding any plugin, only "Main options" will be available.
For another plugins options, please refer to their own documentation.