# raml-mocker-server

> Node module to run server mocking API described in RAML files

Latest version **0.1.6** (published 2016-04-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install raml-mocker-server
pnpm add raml-mocker-server
yarn add raml-mocker-server
bun add raml-mocker-server
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2016-04-04 |
| First published | 2015-01-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Dmitry Smirnov |
| Maintainers | dmitri.smirnov |
| Keywords | mock, mocker, proxy, server, RAML, REST, API |

## Links

- npm: https://www.npmjs.com/package/raml-mocker-server
- Repository: https://github.com/dmitrisweb/raml-mocker-server
- Homepage: https://github.com/dmitrisweb/raml-mocker-server#readme
- Issues: https://github.com/dmitrisweb/raml-mocker-server/issues
- npm.io page: https://npm.io/package/raml-mocker-server

## Dependencies (5)

- [cors](https://npm.io/package/cors.md) ^2.7.1
- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [express](https://npm.io/package/express.md) ^4.13.3
- [chokidar](https://npm.io/package/chokidar.md) ^0.12.6
- [raml-mocker](https://npm.io/package/raml-mocker.md) ^0.2.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.1.6 (latest) — 2016-04-04
- 0.1.5 — 2015-12-22
- 0.1.4 — 2015-12-01
- 0.1.3 — 2015-10-26
- 0.1.2 — 2015-02-27
- 0.1.1 — 2015-02-05
- 0.1.0 — 2015-01-21

## README

# raml-mocker-server
Node module to run server mocking API described in RAML files



Objective
---
This plugin make use of [raml-mocker](https://github.com/RePoChO/raml-mocker) module. It run a [Express](http://expressjs.com/) server and configure endpoints and responce from RAML files.

How to use
---

Basic, this will create server on port 3030

```javascript
var api = require('raml-mocker-server');

var options = {
    path: 'test/raml' // path to folder with RAML files
};

var callback = function (app){
	// Express app could be used to configure more paths
    console.log('All RAML files parsed and API endpoints defined');
};

// returns created server
var server = api(options, callback);
```

* [test/testApp.js](test/testApp.js)

Add API to existing web server:

* [test/testAppExpress.js](test/testAppExpress.js)



Options
---

| Name         | Type          | Default value | Description                                                  |
| ------------ | ------------- | ------------- | -------------------------------------------------------------|
| port         | number        | 3030          | defines server port                                          |
| path         | string        | 'raml'        | path to raml folder, relative to the execution context       |
| prefix       | string, array | ''            | prefixing all API endpoints described in RAML                |
| debug        | boolean       |               | enable logging debug info to the console                     |
| watch        | boolean       |               | enable watching on RAML files                                |
| staticPath   | string        |               | defines path to the static folder                            |
| prioritizeBy | string        | 'schema'      | defines the priority of the endpoint response if both 'schema' and 'example' are defined |
| app          | object        |               | if server already exists you can pass express app, Express app, no need to specify *port* and *staticPath* |



#### [Changelog](CHANGELOG.md)

---
_Source: https://npm.io/package/raml-mocker-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
