Working modes
Server can work in the following modes:
record
. Server proxies requests to thetargetUrl
and saves responses to file.replayOrRecord
. Server reads response from file. If there are no matching files, goes totargetUrl
and saves response.replay
. Server reads response from file. If there are no matching files, 404 error.replayOrProxy
. Server reads response from file. If there are no matching files, go totargetUrl
.proxy
. Server just proxies to thetargetUrl
Mode is determined by:
mode
param to mockProxy middleware- Using middleware
mockProxyConfig
(must be defined beforemockProxy
middleware) - Using environment variable
KOA_MOCK_PROXY_MODE