Pollux is free fake JSON server with mock API generator with JWT auth. Here you can use this tool to generate fake JSON data or an entire API that you can run on your PC. It generates a full functional code in case you want to run API with JSON on a server. Or, you can just take a JSON file with all the JSON fields with the desired type of data.
For generating fake JSON data, you can create as many fields and bind a type to them. You can generate fields for names, words, images, passwords, emails, UUIDs, Boolean, suffix, cities, abbreviations, adjectives, animal names, and many more. It supports generating data from a lot of different entity types, and you can generate any number of records as well.
Using this Fake JSON Server with Mock API Generator with JWT:
Pollux is completely free to use and you can use it online without any sign up. There is a visual API builder that you can use and it will give you a ZIP file with all the API data & code. It uses json-server
for generating the API. Additionally, it uses json-server-auth
for JWT. You can create multiple models here and even mix them together. The model names are treated as routes and you can request JSON data over them.
So, just go to the website and create your first model. Give it a name and then proceed further.
Now, you just add props to the model. These are basically the fields that will be included in the JSON. So, you can add as many props as you want here. Just type a name and then hit enter.
Next, you start the data type to generate for the props that you have added. It has tons of data types and you can choose them from the list. I mentioned some of them earlier in the post, but there are tons of other data types to choose from.
Now, finally, you specify the number of records to be generated. Next, just hit the “Generate” button and it will give you a ZIP file. The ZIP file contains the code that you can use to run the API server on your PC. Additionally, before downloading the ZIP, you can enable JWT if you want to.
Extract the ZIP file and it has the JSON file with the fake data generated in it.
To run it on your PC, just open the command window in the folder that has all the code files. And then run the commands below, one after another. It will work, given that you have Node.js installed.
npm install
npm run dev
Copy the localhost URL and then paste that in the browser to see the JSON API in action. All the models that you create will be available as routes and you can see the JSON data there with all the relevant fields and fake data that it has generated for you.
If you are a developer and looking for a fake JSON server, then you are at the right place. Just use Pollux and then simply generate mock APIs that you can run on your own PC. Or, if you just need the data, then you can just keep the JSON file and use it wherever you want.
Final thoughts:
I have covered mock API generator before, but Pollux is different and I must say it is also quite an advanced one. If you want to test your apps, then you can use the fake data that this website can generate for you. What’s even best is that it can generate mock API as well for that data that you can integrate directly in your apps for testing.