Serve Mode
One of the Runner’s available modes isserve mode.
The runner can be started in serve mode by setting the WMC_DEFAULT_MODE environment variable to serve,
or switched to this mode using the Runner’s switch endpoint.
This mode starts a local playback session that will continue to serve your configured services
until the runner is stopped or its mode is switched.
Serve Configuration
The serve session started by the Runner can be configured via the same mechanism as therun command
of the WireMock CLI - either via a values file or via environment variables.
Additionally, configuration can be provided at switch time via the HTTP request body.
All options available to the run CLI command are also available to the Runner’s serve mode.
When specifying an option in the "config" field of the HTTP switch request, remove the dash (-) prefix that would normally be used when provided on the command line.
For instance, the --profile option would become "profile" in the request body, like so:
.wiremock directory
in the current working directory of the container.
Starting the Runner In Serve Mode
When starting the runner inserve mode you will need to publish the appropriate ports
for the services you are running along with the port you have configured for the Runner.
Here is a typical example on Linux or macOS when running the Runner on port 9999 and serving two services: