Skip to content

xav-b/mockingbird

Repository files navigation






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

About

Realistic and Pareto-ish API mocker

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published