My team is currently working on a way to quickly mock up a large number of APIs (>50) for use in proof of concept type applications. We want to be able to build these using only a JSON file containing data in the correct structure as input. We are planning to use json-server (https://github.com/typicode/json-server) and push a simple server out to Edge. After we will use a script we wrote to generate the documentation.
As these APIs would begin being hit we are curious whether there will be any load issues with a potentially large number of node servers being spun up all at once. Could this approach be taken to production?
Can anyone validate this approach or if it won't work suggest another one?
Why don't you use BaaS?
I'm still somewhat new to the platform so it was more I already know node and it took me no time to have json-server up and running locally.
Part of the goal of these mock APIs will be to get other developers used to accessing a dev portal to 'shop' for APIs to use in their apps. Can I still do that in BaaS?
Hi @Andy S, json-server is pretty cool! I can see a few use cases for developers. I've tried a few of frameworks out there to generate mock APIs, so I'd provide this post with some recommendations for your consideration:
Hope it helps!
I went back through some of your code on GitHub using Nock and there are definitely a ton of options and features that come with it, I'm going to look into it more.
I think we will likely continue down the json-server path for the type of mocks we are looking to build because of the timeline we're trying to get them done by. Then as we have a little more time, look into other approaches.
Are you modelling the APIs? If you write an OpenAPI spec, then you can get mocking for free.
See apistudio.io