For years, I’ve been creating custom mock APIs for each app
For years, I’ve been creating custom mock APIs for each app. So, here’s an exciting idea I’m implementing today:
1. Create a mock API server to mock the company’s APIs
2. Publish it as an npm package.
3. Share the mock server between teams, like an open source project.
1/x
Here’s what’s in the npm package: An Express server that mocks out all the company’s REST and GraphQL APIs, and includes a comprehensive static dataset.
Result: Any team can use this server to do rapid development and automated testing against locally hosted mocks! 😍
A few people suggested that having each API team create and support mocks for their APIs would be preferable.
While I agree, that's not typically practical. Why? Because the API teams don't benefit from doing so.
As a consumer, I benefit, so I'm motivated to create the mocks.