You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
##Usage as Mock
Instead of forwarding all requests to another server, the tool can also be used to return mock responses.
(Which will also be verified against a RAML file.)
Use the -m option instead of -t to run in mock mode:
The files in directory mock-data will be used as responses.
A request to localhost:8099/admin/user/ will be responded with any of the files mock-data/admin/user.{json|xml|txt},
if one exists.
Responses can be specialized by prepending the HTTP method:
A GET request will first search for mock-data/admin/GET-user.json and then for the general mock-data/admin/user.json.
If a file named mock-data/admin/META-user.json exists, it is used to define response code and reponse headers.
An example file looks like { "code": 202, "headers": {"X-meta": "get!"} }.
If no matching file for a request is found, RESPONSE.json is searched up the directory structure and used if found.
mock-data/RESPONSE.json would be used whenever no exact matching file is found. The same is true for META- files.
##Usage from Javascript
There is a special support for usage from javascript.