Live data from Hacker News

Ask HN: Best Way to Mock APIs in 2020?

news.ycombinator.com

1–10 of 63 posts

Re: Ask HN: Best Way to Mock APIs in 2020?

#5
Depends how advanced the mocking behaviour requirements are. For most projects, I find json-server sufficient.

Remember that perfect is the enemy of good enough. If you're looking to be blown away by your mock server you may never get round to building your product.

Re: Ask HN: Best Way to Mock APIs in 2020?

#9
I've found mitmproxy (https://mitmproxy.org) in reverse mode really useful. I'm a mobile dev and when the backend work is still pending I usually mock the backend requirements by selectively patching or adding endpoint support, it can be used like so:

    mitmproxy --mode reverse:https://my.privateapi.com -s ./path/to/mockscript.py

This allows me to implement most of the UI and server interactions w/o being blocked by server work.
Post reply on HN