3 ms·
For early stage and hackathon-style API mocking, JSON Server is pretty cool. You implement a JSON file of objects that gets inferred as endpoints and served up
by tedmiston 8y ago
For early stage and hackathon-style API mocking, JSON Server is pretty cool. You implement a JSON file of objects that gets inferred as endpoints and served up as an API.
https://github.com/typicode/json-server https://github.com/typicode/json-server
For a fancier solution, Swagger / OpenAPI spec is useful. It has a feature called API Auto Mocking which you can serve with SwaggerHub. [The free tier includes this feature by the way.]
https://app.swaggerhub.com/help/integrations/api-auto-mocking https://app.swaggerhub.com/help/integrations/api-auto-mockin...
https://swagger.io/tools/swaggerhub/ https://swagger.io/tools/swaggerhub/
You can also use Swagger Codegen to generate server stubs and API clients as code in various languages once you're ready to break out of the mock API.
https://github.com/swagger-api/swagger-codegen https://github.com/swagger-api/swagger-codegen
That's the route I'd go personally as this tooling is available for free, is fairly mature, and has a strong community behind it at this point.
There are a few other similar alternatives that I know less about such as WireMock (http://wiremock.org/ http://wiremock.org/) and Stoplight (https://stoplight.io/ https://stoplight.io/). Postman also has a mock server feature if you happen to already use that.