Git Product home page Git Product logo

api-mock's Introduction

API-Mock

Build Status Coverage Status

NPM

API-Mock is a node.js npm module that generates a mock server (express) from your API specification. Document your API in the API blueprint format, and API-Mock mocks your routes and sends the responses defined in the api spec.

Install

API-Mock requires node.js, and npm.

npm install -g api-mock

Installing from source

If you wish to install from source, you will need to build the library files manually (only the CoffeeScript source is committed to the repository). To do this, simply run:

scripts/build

or

npm build

Usage

Usage:
  api-mock <path to blueprint>  [OPTIONS]

Example:
  api-mock ./apiary.md --port 3000

Options:
  --port, -p          Set which port api-mock should listen on.
                                                                 [default: 3000]
  --ssl-enable, -s    Enable SSL support.
                                                                [default: false]
  --ssl-port          Set which port api-mock should listen on for SSL traffic.
                                                                 [default: 3080]
  --ssl-host          Set hostname for SSL server.

  --ssl-cert          Set path for SSL certificate file.
                                                       [default: "./server.crt"]
  --ssl-key           Set path for SSL key file.
                                                       [default: "./server.key"]
  --cors-disable, -c  Disable CORS headers.
                                                                [default: false]
  --color, -k         Colorize cli output.
                                                                 [default: true]
  --help              Show usage information.

  --version           Show version number.

Contribution

Contributions in the form of issues or pull requests are more than welcome! Make sure to follow Api-Mock issues.

Pull Requests

  • Fork from the development branch
  • Write good, clean, readable code
  • Write tests for your contribution
    • Run tests with npm test
    • Other helper scripts available in /scripts
    • Keep the test coverage high
  • Create a pull request

api-mock's People

Contributors

ecordell avatar kewang avatar lucascaro avatar rafaelmenta avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.