@easynvest/mock-server
[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors)
Last updated 2 years ago by rafaellucio .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @easynvest/mock-server -g
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.5.4                                ...           latest (2 years ago)

15 Versions

  • 0.5.4                                ...           2 years ago
  • 0.5.3                                ...           2 years ago
  • 0.5.2                                ...           2 years ago
  • 0.5.1                                ...           2 years ago
  • 0.4.2                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.1.6                                ...           2 years ago
  • 0.1.5                                ...           2 years ago
  • 0.1.4                                ...           2 years ago
  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 17
Last Day 0
Last Week 16
Last Month 1
Dependencies (20)
Dev Dependencies (11)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |