Working modes
Server can work in the following modes:
record. Server proxies requests to thetargetUrland saves responses to file.replayOrRecord. Server reads response from file. If there are no matching files, goes totargetUrland 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:
modeparam to mockProxy middleware- Using middleware
mockProxyConfig(must be defined beforemockProxymiddleware) - Using environment variable
KOA_MOCK_PROXY_MODE