Default Response
The Mockgee default response feature allows developers to define a default response for a Mock API endpoint in cases where the incoming request does not match any configured request matcher.
Steps to configure it
To set a default mock response for an endpoint in Mockgee when the request matcher doesn't match files, follow these steps from the Mockgee UI page:
- Navigate to the Mock folder:
- From the Mockgee UI page, locate and click on the "Mock" folder in the navigation.
- Access API | Services:
- Within the Mock folder, find and click on "API | Services."
- Select the project:
- In the API | Services page, click on the specific project that contains the endpoint for which you want to set a default response.
- Access endpoint options:
- Inside the mock project, locate the endpoint for which you want to set the default response. Click on the three-dotted options on the right-hand side.
- Choose Proxy/Default response:
- From the options menu, click on "Proxy/Default response."
- Configure the default response:
- On the Mock Config page, select the default response option from the dropdown menu.
- Configure the default response settings as needed.
- Save the configuration:
- After configuring the default response, click on the "Save" button to save the changes.
By following these steps, you can set a default mock response for a specific endpoint in Mockgee, ensuring that a predefined response is provided when the request matcher doesn't match any files.