Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Speed up dev, decouple API and client teams, with offline mock API's (mocktastic.com)
8 points by bgdam on May 30, 2018 | hide | past | favorite | 3 comments



Hi HN,

This is a repost. I posted the original about two months ago, and while it got a bunch of upvotes, I didn't receive much criticism or comments.

Mocktastic is a downloadable electron app, which provides a simple GUI to configure and run your own mock HTTP API servers. It also has team features which allow a single person in your team to configure a server, and then publish that server to everyone else in your team.

This is a tool that I wrote after observing multiple scenarios with front-end teams waiting on back-end teams to finish building out an API, so that the FE code could be integrated and tested. The most common solution was that FE teams would mock the API by using hardcoded JSON in their codebase until the back-end API was ready.

9 out of 10 times, when the back-end API was finally made ready, the interface had changed considerably from what was agreed upon with the front-end teams and so the front-end teams were forced to rework.

Mocktastic allows you to eliminate such problems, since the mock API configuration can be updated by the back-end teams, and once published, all the front-end team members will receive notifications of the change and they can then run the newer version with a single click.

Further, mocktastic also allows servers to be configured such that, all incoming requests are proxied to another server, and if that server returns a 404 or connection failure error, then fallback to the mock response defined. This allows backend developers to proxy the mock API to their own machines, and thereby provide live updates based on the state of their work.

In addition, any proxied responses can also be recorded by mocktastic, thereby eliminating the need to manually configure mock API responses.

Mocktastic also provides some other useful features such as:

   * multiple responses (with different/same status codes) for the same end point (to test success and failure cases easily)

   * easy to understand ExpressJS style route definitions and parameters

   * ability to serve static files

   * request and response logs for aiding with debugging

   * Rich Code Editor for the response body, which automatically detects syntax based on content-type header
You can check it out at: https://mocktastic.com/?ref=hn2

Please provide your comments and criticism.


How does this compare to other mock api tools, for example, mockoon? What's your secret sauce?


Didn't know mockoon existed until now. I had pretty much only used Postman's server mock functionality and a few command line tools. Comparing those + mockoon and mocktastic, I'd say major differences are:

   - Runs offline on your own machine. Only needs internet for syncing server configuration (unlike postman).

   - Has team support so can easily share the server config 

   - Has multiple responses per endpoint being mocked. So can quickly switch between testing success response and failure response.

   - Can proxy responses with either the proxy server being the fallback or the configured mock endpoint being the fallback.
  
   - Can record and replay the proxied requests

   - Provides a full log of all requests and responses served by each mock server




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: