Releases: dhuan/mock
Releases · dhuan/mock
v0.8.1
Update changelog for 0.8.1
v0.8.0
Release 0.8.0
v0.7.0
ADDED
- Responses with
exec:<SHELL COMMAND>is now supported; - Endpoints can now be defined through command-line parameters, such as:
--route foo/bar --method post --status-code 201 --response "Hello world!";
CHANGED
- The
--configcommand-line parameter is no longer mandatory since now endpoints can be defined without configuration files;
FIXED
- Defining responses referenced through files with absolute path fails. (with relative file paths no issues, only absolute);
v0.6.0
ADDED
- Responses can now read environment variables. Previously only shell-script responses had that ability - now any kind of response, either file or static text can achieve the same. Check Reading Environment Variables in the User Guide.
- New variable added to read current request's host
MOCK_REQUEST_HOST.
v0.5.0
Breaking changes
- "Endpoint Parameters" has been renamed to "Route Parameters"
Example - reading a parameter named foo:
Before: MOCK_REQUEST_ENDPOINT_PARAM_FOO
Now: MOCK_ROUTE_PARAM_FOO
Check the User Guide for more details.
Features & enhancements
- Route Parameters can be captured in the Response string. Before, the parameters could only be read by Shell Scripts Responses. A response can now be set as follows:
{
"endpoints": [
{
"route": "book/{book_name}",
"method": "GET",
"response": "file:./books/${book_name}.txt"
}
]
}- Static files support, with
fs:./path/to/files; - Endpoints can be configured without any HTTP Method - it will default to
GET;
v0.4.0
- New Request Handler Variable added: MOCK_HOST for retrieving the current host that the Mock server is listening on.
- Enable JSON Responses to include environment variables, which previously could only be read by Shell Script responses.
Bugs fixed:
- Trying to assert with "Json Body" on a Request that didn't have any payload would result in 500 Status Code API Error;
v0.3.0
- Endpoint Routes can now contain wildcards or placeholder variables;
- Shell Script Response Handlers now support params, such as:
"response": "sh:./my_shell_script.sh some_param another_param"; --delayoption added enabling you to simulate slow APIs;
v0.2.0
Update changelog
v0.1.4
Update CHANGELOG
v0.1.3
Update changelog