New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

apimocker

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apimocker - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc