Skip to content
Realistic and Pareto-ish API mocker
JavaScript Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.taskbook/storage
_examples/newsletter
src
.env
.eslintrc.json
.gitignore
.prettierrc
.travis.yml
.versions
LICENCE
README.md
index.js
jest.config.js
mockingbird.jpeg
package-lock.json
package.json

README.md






Mockingbird

Mockingbird





Fake it until you make it - Docs.




Build Status codecov



Highlight

✔️ Declarative API description

✔️ Endpoints as code to fit all use cases

✔️ Generate data - on the fly or beforehand for more control

✔️ Easily switch scenarios to simulate different use cases

✔️ Support swagger to easily share and interact with the API contract

✔️ Emulate complex scenarios:

  • request delays
  • [todo] authentication

In a Nutshell

# all you need is 5min - let's get started
npm install -g @hackliff/mockingbird

mkdir -p nasa/scenarios && cd nasa

Write a scenario

// in ./scenarios/build.js

const success = (req, res) => res.status(204).json({ request_id: Math.random() })

module.exports = { success }

Write some config

title: 'NASA'
storage: 'json'

scenarios:
  - name: healthcheck

endpoints:
  - description: 'build spaceship'
    method: POST
    module: ./scenarios/build
    uri: /v2/spaceships
    scenario: async success
    latency: 4000

Serve a full-featured API: mockingbird serve --port 4000

Profit: curl -X POST -d '{ "engine": "nuclear" }' localhost:4000/v2/spaceships

Installation

Usage

Configuration

Scenarios


Workflow

🚀 Release

We follow a few industry standards.

  • Git flow
  • Semantic release
  • Release notes are only generated for major releases.

Local issue tracker

To be progressively migrated to github issues as we release it open source

The project manages todos using taskbook. After installing dependencies, source .env to update its configuration and use the local database.

Then use it as indicated on the github readme: npx tb -i.


profile

💖 Shameless plug

Hey nice to meet you, I'm Xavier and I maintain this project.

Buy Me A Coffee    subscribe





Mockingbird - API mocker
Built by Xavier Bruhiere and contributors
with a 💻 and some 🍣



TIC logo

You can’t perform that action at this time.