Socket
Socket
Sign inDemoInstall

raml-mocker-server

Package Overview
Dependencies
132
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    raml-mocker-server

Node module to run server mocking API described in RAML files


Version published
Weekly downloads
15
decreased by-6.25%
Maintainers
1
Install size
83.3 MB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 04 Apr 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc