0.1.6 • Published 8 years ago

raml-mocker-server v0.1.6

Weekly downloads
18
License
MIT
Repository
github
Last release
8 years ago

raml-mocker-server

Node module to run server mocking API described in RAML files

Objective

This plugin make use of raml-mocker module. It run a Express server and configure endpoints and responce from RAML files.

How to use

Basic, this will create server on port 3030

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);

Add API to existing web server:

Options

NameTypeDefault valueDescription
portnumber3030defines server port
pathstring'raml'path to raml folder, relative to the execution context
prefixstring, array''prefixing all API endpoints described in RAML
debugbooleanenable logging debug info to the console
watchbooleanenable watching on RAML files
staticPathstringdefines path to the static folder
prioritizeBystring'schema'defines the priority of the endpoint response if both 'schema' and 'example' are defined
appobjectif server already exists you can pass express app, Express app, no need to specify port and staticPath

Changelog

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago