Comparing version 0.2.5 to 0.2.6
{ | ||
"name": "apimocker", | ||
"description": "Simple HTTP server that returns mock service API responses to your front end.", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"engines": {"node": ">=0.10.0"}, | ||
@@ -6,0 +6,0 @@ "author": "Greg Stroup <gstroup@gmail.com>", |
@@ -48,10 +48,10 @@ # apimocker | ||
* config.json file format has changed with the 0.1.6 release. See below for the new format. (Old config.json file format is deprecated and doesn't support new features, but still functioning.) | ||
* Services can be configured to return different responses, depending on a request parameter. | ||
* Content-type for a service response can be set for each service. If not set, content-type defaults to application/xml for .xml files, and application/json for .json files. | ||
* HTTP Status code can be set for each service. | ||
* Latency (ms) can be set to simulate slow service responses. Latency can be set for a single service, or globally for all services. | ||
* mockDirectory value should be an absolute path. | ||
* Allowed domains can be set to restrict CORS requests to certain domains. | ||
* Allowed headers can be set. (Default is to set "access-control-allow-headers: Content-Type" if not specified in config file.) | ||
* Services can be configured to return different responses, depending on a request parameter. | ||
* config.json file format has changed with the 0.1.6 release. See below for the new format. (Old config.json file format is deprecated and doesn't support new features, but still functioning.) | ||
* mockDirectory value should be an absolute path. | ||
@@ -101,3 +101,3 @@ ```js | ||
### Switches | ||
### Switch response based on request parameter | ||
In your configuration, you can set up a "switch" parameter for each service. If set, apimocker will check the request for this parameter, and return a different file based on the value. For instance, if you set up a switch as seen above for "nested/ace", then you can will get different responses based on the request sent to apimocker. A JSON POST request to the URL "http://localhost:7878/nested/ace" with this data: | ||
@@ -104,0 +104,0 @@ ```js |
39041