mockoon logo with application screenshot

Mockoon new API playground

Discover Mockoon new API playground, a ready-to-use mock API for all your prototyping needs.

Guillaume, Founder
Posted by Guillaume, Founder
|
dev blogproduct

šŸ„³ We are happy to announce the release of a new tool: the API playground.

It is a free and ready-to-use mock API offering multiple CRUD endpoints with fake data. The perfect tool to quickly prototype your frontend applications, test your API calls, or learn about APIs.

Ā šŸ”Ž How to use the API playground?

The API playground is available at https://playground.mockoon.com and offers different resources containing fake data: /contacts, /movies, /photos, /posts, /todos, /users. They work like any other API with various endpoints and CRUD operations, like GET, POST, PUT, PATCH and DELETE.

Even better, all actions like updates or deletes are persisted (until the next reset šŸ˜‰)! Making it a great tool to test your frontend applications in a more realistic environment.

āž”ļø Head over to the API playground documentation to learn more!

Ā āš™ļø How we built the API playground

All the fake data were generated using Faker.js and our templating system. We picked some from our list of templates šŸ“ƒ and created some new ones using our AI assistant šŸ¤–.

We then created a Mockoon project with all the CRUD endpoints. CRUD endpoints are fully automated and create multiple routes at runtime to let you manipulate a data bucket, a sort of basic JSON database.

Mockoon CRUD endpoints

We saved the project data file in a new repository and created a Dockerfile using Mockoon CLI.

Here is the command we used: mockoon-cli dockerize -d ./dist/playground-mock.json -o ./dist/Dockerfile -p 8080. The CLI dockerize command will generate a Dockerfile with all the necessary instructions to run your mock (COPY, EXPOSE, etc.).

Finally, we deployed the mock API on Google Cloud Run, using Cloud Build. Setting up Cloud Build was a breeze, and we were able to deploy the API playground in a few minutes. After authenticating Cloud Build with GitHub, it will listen for pushes on a specific branch of the repository (here main) and then build and deploy the Docker image to Cloud Run based on the provided Dockerfile.

This way, we can easily update the playground API by simply pushing a new version of the repository.

We also use Cloudflare rate limiting to prevent abuse and ensure the API playground is always available.

Ā šŸ¤ Contribute to the API playground

The API playground is open-source and available on GitHub. Feel free to contribute by adding new resource endpoints or reporting any issues you may encounter.

Happy mocking! šŸš€