Socket
Socket
Sign inDemoInstall

@mocks-server/plugin-admin-api

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mocks-server/plugin-admin-api

Plugin for Mocks Server. Provides a REST API for administrating settings, fixtures and behaviors


Version published
Weekly downloads
33K
decreased by-62.53%
Maintainers
1
Weekly downloads
 
Created
Source

Build status Coverage Status Quality Gate

NPM dependencies Renovate Last commit Last release

NPM downloads License

Mocks Server Mocks Server Plugin Admin Api

Plugin for Mocks Server that provides an API REST that allows to change dinamically the current behavior, change delay time, and another Mocks Server options.

This is very useful when running acceptance tests, as you can change the behavior of the api simply making an HTTP request in your tests before method, for example.

Usage

This plugin is included in the main distribution of the Mocks Server project, so you can refer to the official documentation website.

Options

  • adminApiPath - Base path for the administration api. Default is "/admin". You should change it only if there is any conflict with the api you are mocking.
  • adminApiDeprecatedPaths - Boolean option, disables deprecated "/mocks" api path, which is still enabled by default.

Read more about how to define options for the mocks-server plugins here.

API Resources

Available api resources are:

  • GET /admin/about Returns plugin information.
    • Response body example: { "version": "1.2.0" }
  • GET /admin/behaviors Returns behaviors collection.
  • GET /admin/behaviors/:id Returns an specific behavior.
  • GET /admin/fixtures Returns fixtures collection.
  • GET /admin/fixtures/:id Returns an specific fixture.
  • GET /admin/settings Returns current server settings.
    • Response body example: { "delay": 0, behavior: "foo-behavior", path: "mocks" }
  • PATCH /admin/settings Changes current server settings.
    • Request body example: { "delay": 3000 }

Deprecated api resources under "/mocks" api path are still available.

Contributing

Contributors are welcome. Please read the contributing guidelines and code of conduct.

Keywords

FAQs

Package last updated on 21 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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