Hacker News new | ask | show | jobs
Show HN: Service Mocker – Mock your API server inside the browsers (github.com)
2 points by Dolphin_Wood 3438 days ago
1 comments

Something very similar already exists: https://github.com/pretenderjs/pretender

I don't think it's a good idea in general to mock server responses because they are subject to change while the mocks don't, better to just run the server and make a real request.

The main difference between Service Mocker and pretender is that we are using service worker API, therefore the HTTP requests and responses are real and can be inspected in devtools.

And usually, we mock an API while the server isn't ready to use. For example, when you just started a new project with backend dudes, it's highly possible that the server is unusable for the first few days, that is the best time to mock your APIs with such a tool :).