[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors)


0.5.44 years ago4 years agoMinified + gzip package size for @easynvest/mock-server in KB


Mock Server

All Contributors

Mock Server is an application that allows the mocking of requests served over HTTP or HTTPS, it also enables the creation of different response scenarios for those requests.

In addition to other cases, this is quite useful in situations where in order to get you work done you need to use an API that is not completely finished. On these occasions, Mock Server will help you simulate this API's endpoints and finish your work without delays.


With NPM:

$ npm install @easynvest/mock-server --save-dev

With Yarn:

$ yarn add @easynvest/mock-server --dev


Configure Mock Server with the command bellow:

$ mock-server init

Start the server:

$ mock-server start

For more information about the CLI:

$ mock-server --help



When this feature is enabled, Mock Server will not dispatch requests to the configured endpoint, tha is, it will immediately return the last retrieved value from the requested endpoint. In other words, Mock Server will be in offline mode.





  • Returns the configuration setup

    GET /request-api

  • Toggle the cache feature

    GET /requests

  • Returns all the mocked requests

    POST /requests

  • Adds a new request
      "type": custom | default ,
      "method": [POST, GET, PUT, DELETE, PATCH, HEAD],
      "url": Path,
      "status": HTTP status,
      "response": Resposta da requisição,
      "query": Parâmetros de URL

    GET /requests/:id

  • Returns the mocked request metada with the specified ID

    PUT /requests/:id

  • Updates the mocked request metada with the specified ID

    DELETE /requests/:id

  • Remove the mocked request metada with the specified ID

    GET /scenarios

  • Returns the existing scenarios



Exemplos de uso



The main goal of this repository is evolve Mock Server so it can increasingly contribute with the agility and praticity in the software development, therefore any kind of contribution is welcome. If you wish join this purpose read our Getting Started Guide to learn more.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.