-
Notifications
You must be signed in to change notification settings - Fork 3
cli‐zimic‐server
zimic-interceptor server
contains commands to manage interceptor servers.
An interceptor server is a standalone server that can be used to handle requests and return mock responses. It is used in combination with remote interceptors, which declare which responses the server should return for a given request. Interceptor servers and remote interceptors communicate with remote-procedure calls (RPC) over WebSocket.
Start an interceptor server.
zimic-interceptor server start [-- onReady]
Positionals:
onReady A command to run when the server is ready to accept connections.
[string]
Options:
-h, --hostname The hostname to start the server on.
[string] [default: "localhost"]
-p, --port The port to start the server on. [number]
-e, --ephemeral Whether the server should stop automatically
after the on-ready command finishes. If no
on-ready command is provided and ephemeral is
true, the server will stop immediately after
starting. [boolean] [default: false]
-l, --log-unhandled-requests Whether to log a warning when no interceptors
were found for the base URL of a request. If an
interceptor was matched, the logging behavior
for that base URL is configured in the
interceptor itself. [boolean]
You can use this command to start an independent server:
zimic-interceptor server start --port 4000
Or as a prefix of another command:
zimic-interceptor server start --port 4000 --ephemeral -- npm run test
The command after --
will be executed when the server is ready. The flag --ephemeral
indicates that the server
should automatically stop after the command finishes.
© Zimic
Docs |
Issues | Examples |
Roadmap
Help us improve these docs!
Report an issue or
edit on GitHub.