Skip to content

nicupavel/blueprint-dynamic-mock

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 

Apiary Dynamic API Mock Server

Creates a mock server from a Blueprint API file with the posibility to dynamically bind Javascript function to API routes for dynamic content.

Installing

    git clone https://github.com/nicupavel/blueprint-dynamic-mock.git
    cd blueprint-dynamic-mock
    npm install

Using

  1. Add or download your Apiary/Blueprint API file (usually with .apib or .md extension)
  2. Edit config.json and set the path to the above API file
  3. Start mock server: npm run start
  4. Test: curl -X GET http://127.0.0.1:19090/api/4/machine/time

Customising

  1. Edit user/aliases.json and create any aliases for api routes if needed
  2. Edit user/responses.json and add any dynamic responses that you need for API calls. If none defined the static response from API file is returned. See responses.json for an example.

In depth example

This project is used in RainMachine Web UI Demo to mock the entire RainMachine API. rainmachine branch has the entire example that is used live. To run RainMachine example:

git checkout origin/rainmachine -b rainmachine
git submodule update --init --recursive
npm run start

About

Blueprint API Mock Server that allows dynamic content mocking.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published