Socket
Socket
Sign inDemoInstall

@mocks-server/main

Package Overview
Dependencies
345
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @mocks-server/main

Mock Server supporting multiple route variants and mocks


Version published
Weekly downloads
21K
increased by1.11%
Maintainers
1
Install size
51.7 MB
Created
Weekly downloads
 

Readme

Source

Mocks Server logo

Build Status Coverage Quality Gate Downloads Renovate Last release Last commit License


Introduction

Node.js mock server running live, interactive mocks in place of real APIs. It makes able to define many different responses for a same route, so, you can change the whole mocked API behavior by simply changing the response of one or many routes while the server is running.

Usage

Define your mocked API routes in YAML, JSON, JavaScript or TypeScript files. Mocks Server loads them automatically and watches for changes. Defining routes using any of the available APIs is also possible.

Routes can be defined in many ways, from plain objects to plain text and even Express middlewares, and they can act in different ways also, from sending a response to proxy the request to another host.

Configuration

Configure the server simply modifying the configuration file at the root folder of your project, or use command line arguments, or even environment variables.

For changing options while it is running, you can also use any of the available integrations tools that enable live interactions with Mocks Server.

Integrations

Providing a Javascript API, an interactive command line interface and a REST API for changing the responses of the mocked API while it is running, it is easy to use both for development and testing. Tools providing integrations with other ecosystems are also available, such as Cypress commands.

Documentation

To check out docs, visit www.mocks-server.org.

Ecosystem

ProjectStatusDescription
mainmain-statusMain distribution. It includes all plugins preinstalled
corecore-statusPluggable core. It can be used programmatically also
plugin-admin-apiplugin-admin-api-statusPlugin providing an administration REST API
plugin-inquirer-cliplugin-inquirer-cli-statusPlugin providing an administration interactive CLI
plugin-openapiplugin-openapi-statusPlugin allowing to create routes and collections from OpenApi definitions
plugin-proxyplugin-proxy-statusPlugin providing Proxy route handler
admin-api-clientadmin-api-client-statusAPI client for plugin-admin-api
admin-api-client-data-provideradmin-api-client-data-provider-statusAPI client for plugin-admin-api built using data-provider
admin-api-pathsadmin-api-paths-statusDefinition of plugin-admin-api routes
cypress-commandscypress-commands-statusCypress commands to administrate Mocks Server
configconfig-statusProvides configuration to core components and plugins
nested-collectionsnested-collections-statusNested collections manager. Used to provide alert namespaces to plugins
loggerlogger-statusWinston-based logger with namespaces and events emitter

Contributing

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

Keywords

FAQs

Last updated on 29 May 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc