@easynvest/mock-server

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

Showing:

Popularity

Downloads/wk

145

GitHub Stars

12

Maintenance

Last Commit

3yrs ago

Contributors

11

Package

Dependencies

20

License

Apache-2.0

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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.

Installation

With NPM:

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

With Yarn:

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

Configuration

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

Features

Cache

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.

Scenarios

//TODO

Endpoints

GET /

  • 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

Documentação

//TODO

Exemplos de uso

//TODO

Contribuindo

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.

Contributors

Thanks goes to these wonderful people (emoji key):


Guilherme Mangabeira Gregio

💻 📖 ⚠️ 🐛 💡 🔧

Lucas de Castro

💻 📖 ⚠️

Marcelo Silva

💻

Bruno Braga Chagas

💻 📖 ⚠️

Rafael Lucio

💻 📖 ⚠️ 🐛

sampaiojulio

💻 📖 ⚠️

Wellyngton Amaral Leitão

💻 📖 ⚠️

Celso Henrique

💻 ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial