Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

raml-mocker-server

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

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

  • 0.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 04 Apr 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc