Introducing BDSM

(Based on a true story)

We had a problem

The frontend team was way way (way) ahead of the server team. More than half the APIs we needed weren't done and the delays kept piling on.

And this wasn't new either, as the backend teams meticulously labor on each API, and the frontend teams run ahead adding more pages and functionality, and craving for more of those juicy APIs.

We can always mock some APIs... Maybe add if statements to the code returning built in JSONs? Use third party server mocks that are hard to set up and don't work well in tandem with the APIs that are implemented? Perhaps a small Node server to proxy everything and mock what is needed?

The pain was real

But pain doesn't have to be bad... and so,

**drum roll**

we would like to introduce - BDSM.

What is BDSM?

BDSM = "BaD ass Server Mocks" or:

"A simple frontend only tool that allows you to easily mock unimplemented server APIs"

PS. Don't google it yet, we are not on the front page...

How simple?

  1. Install BDSM
    npm install bdsm --save-dev and import 'bdsm';
  2. Fire up your app and have it access a "broken" API endpoint
  3. Click the BDSM icon and select the "broken" request
  4. Tell BDSM how to mock it
  5. Re-run the request
  6. Win!

Simple BDSM usecase

Why is it cool?

  • No need to rely on 3rd party servers and configurations.
  • No need to write / maintain local mocking servers
  • No need to add "temp" and "debug" code into your project
  • Super easy to mock / un-mock APIs
  • We actually use it on all our projects - and can't stop

And that's not all

Since we loved BDSM so much, we kept adding features. Now if you want to mock a group of server responses to return different values for testing, you can. E.g. return a full / empty / half-empty shopping cart. You can easily create multiple scenarios and switch between them with a single click.

Want to dynamically mock stuff? The BDSM library has a full API.

Coming soon - complete filesystem synchronization, so you can save your mocks with your project in Git and always have the correct mocks load for each branch/tag/version on every developer's machine.

Give BDSM a chance!

Quick try out in thimble

Share the pain

More comments and discussion on Hackernews