Skip to content
This repository was archived by the owner on Mar 28, 2022. It is now read-only.

Commit d78b1a8

Browse files
committed
Add plugin documentation
1 parent 5afebee commit d78b1a8

1 file changed

Lines changed: 33 additions & 31 deletions

File tree

README.md

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,51 @@
55
[![NPM downloads][npm-downloads-image]][npm-downloads-url] [![License][license-image]][license-url]
66

77

8-
# [![Mocks Server][logo-url]][website-url] Mocks Server
8+
# [![Mocks Server][logo-url]][website-url] Plugin for administrating Mocks Server through a REST API.
99

10-
This package provides a server that simulates API behaviors. It can be added as a dependency of your project, and started simply running an NPM command.
10+
Plugin for [Mocks Server][[website-url]] providing an API REST that allows to change dinamically the current behavior, change delay time, and another [Mocks Server options][options-url]
1111

12-
## Documentation
12+
This is __very useful when running acceptance tests, as you can change the behavior of the api__ simply with a request in your tests `before` method, for example.
1313

14-
Please refer to the [project documentation website][website-url]:
14+
## Usage
1515

16-
* [Get started](https://www.mocks-server.org/docs/get-started-intro)
17-
* [Tutorials](https://www.mocks-server.org/docs/tutorials-static)
18-
* [Configuration](https://www.mocks-server.org/docs/configuration-options)
16+
This plugin is included in the [main distribution of the Mocks Server project][main-distribution-url], so you can refer to the [official documentation website][website-url].
1917

20-
## Why a mocks server?
18+
## API Resources
2119

22-
Controlling the responses of the api will improve the front-end development workflow, avoiding early dependencies with back-end. It also improves the testing and development of error cases or another cases that are commonly hard to reproduce in the real api.
20+
Available api resources are:
2321

24-
Defining the api responses during the earliest phases of development will improve the communication among team members and align their expectations.
25-
26-
Working with Node.js, it integrates better in front-end projects as any other NPM dependency, and it will be easier for front-end developers to maintain the mocks.
22+
* `GET` `/mocks/behaviors/current` Returns current behavior.
23+
* `PUT` `/mocks/behaviors/current` Set current behavior.
24+
* Request body example: `{ "name": "behavior-name" }`
25+
* `GET` `/mocks/settings` Return current server settings.
26+
* Response body example: `{ "delay": 0 }`
27+
* `PUT` `/mocks/settings` Change current server settings.
28+
* Request body example: `{ "delay": 3000 }`
2729

2830
## Contributing
2931

3032
Contributors are welcome.
3133
Please read the [contributing guidelines](.github/CONTRIBUTING.md) and [code of conduct](.github/CODE_OF_CONDUCT.md).
3234

3335
[website-url]: https://www.mocks-server.org
36+
[main-distribution-url]: https://www.npmjs.com/package/@mocks-server/main
37+
[options-url]: https://www.mocks-server.org/docs/configuration-options
3438
[logo-url]: https://www.mocks-server.org/img/logo_120.png
35-
[inquirer-url]: https://www.npmjs.com/package/inquirer#support-os-terminals
36-
[inquirer-support]: https://www.npmjs.com/package/inquirer#support-os-terminals
37-
38-
[coveralls-image]: https://coveralls.io/repos/github/mocks-server/main/badge.svg
39-
[coveralls-url]: https://coveralls.io/github/mocks-server/main
40-
[travisci-image]: https://travis-ci.com/mocks-server/main.svg?branch=master
41-
[travisci-url]: https://travis-ci.com/mocks-server/main
42-
[last-commit-image]: https://img.shields.io/github/last-commit/mocks-server/main.svg
43-
[last-commit-url]: https://github.com/mocks-server/main/commits
44-
[license-image]: https://img.shields.io/npm/l/@mocks-server/main.svg
45-
[license-url]: https://github.com/mocks-server/main/blob/master/LICENSE
46-
[npm-downloads-image]: https://img.shields.io/npm/dm/@mocks-server/main.svg
47-
[npm-downloads-url]: https://www.npmjs.com/package/@mocks-server/main
48-
[npm-dependencies-image]: https://img.shields.io/david/mocks-server/main.svg
49-
[npm-dependencies-url]: https://david-dm.org/mocks-server/main
50-
[quality-gate-image]: https://sonarcloud.io/api/project_badges/measure?project=mocks-server-main&metric=alert_status
51-
[quality-gate-url]: https://sonarcloud.io/dashboard?id=mocks-server-main
52-
[release-image]: https://img.shields.io/github/release-date/mocks-server/main.svg
53-
[release-url]: https://github.com/mocks-server/main/releases
39+
40+
[coveralls-image]: https://coveralls.io/repos/github/mocks-server/plugin-admin-api/badge.svg
41+
[coveralls-url]: https://coveralls.io/github/mocks-server/plugin-admin-api
42+
[travisci-image]: https://travis-ci.com/mocks-server/plugin-admin-api.svg?branch=master
43+
[travisci-url]: https://travis-ci.com/mocks-server/plugin-admin-api
44+
[last-commit-image]: https://img.shields.io/github/last-commit/mocks-server/plugin-admin-api.svg
45+
[last-commit-url]: https://github.com/mocks-server/plugin-admin-api/commits
46+
[license-image]: https://img.shields.io/npm/l/@mocks-server/plugin-admin-api.svg
47+
[license-url]: https://github.com/mocks-server/plugin-admin-api/blob/master/LICENSE
48+
[npm-downloads-image]: https://img.shields.io/npm/dm/@mocks-server/plugin-admin-api.svg
49+
[npm-downloads-url]: https://www.npmjs.com/package/@mocks-server/plugin-admin-api
50+
[npm-dependencies-image]: https://img.shields.io/david/mocks-server/plugin-admin-api.svg
51+
[npm-dependencies-url]: https://david-dm.org/mocks-server/plugin-admin-api
52+
[quality-gate-image]: https://sonarcloud.io/api/project_badges/measure?project=mocks-server-plugin-admin-api&metric=alert_status
53+
[quality-gate-url]: https://sonarcloud.io/dashboard?id=mocks-server-plugin-admin-api
54+
[release-image]: https://img.shields.io/github/release-date/mocks-server/plugin-admin-api.svg
55+
[release-url]: https://github.com/mocks-server/plugin-admin-api/releases

0 commit comments

Comments
 (0)