Creates a mock server based on an API Blueprint
Switch branches/tags
Nothing to show
Clone or download
petebrowne Merge pull request #56 from samtsai/upgrade-protagonist
Update protagonist library to latest
Latest commit 746e059 Jan 9, 2018


Maintainers Wanted

This project is no longer under active development and we're looking for a new maintainer (or owner). Please open an issue if you are interested in helping out.

Build Status Coverage Status


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.


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:



npm build


  api-mock <path to blueprint>  [OPTIONS]

  api-mock ./ --port 3000

  --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.


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