GitHub - sinhashubham95/moxy: Mocker + Proxy Application (original) (raw)
Moxy is a simple mocker and proxy application server. Here you can create mock endpoints as well as proxy requests in case no mock exists for the endpoint.
Moxy uses semantic versioning. No API changes will be introduced in the minor and patch version changes. New minor versions might add additional features to the API.
The container will have access to the current local directory and all sub-folders.
This is used to create a new mock endpoint. Each mock endpoint created can be tagged, which means you can create multiple mocks for the same endpoint.
This is used to remove the existing mock endpoint.
This is used to call any endpoint. If any mock exists for that endpoint, then the mocked response will be returned, otherwise the actual endpoint will be called.
The following 2 mandatory headers should be passed with any such request.
Create a mock endpoint as follows.
Create another mock endpoint with the same request method and path but a different context(tag).
Try calling this endpoint with the first tag.
You will get the following response.
Now if you call this with the second tag.
You will get the following response.
Now try deleting the mock for the first tag.
Now again try calling the endpoint with the first tag.
The actual endpoint will be called, and the following response you could see.
Google Images| Advanced Image Search |