Postman mock server VS JSON Server 12th Feb 2021

buildersectionofpostman

In this blog we will see what are the differences between Postman's mock server and JSON Server.Both are used to setup fake api's so that front end developers can start working right away without actual need of backend code. (Ofcourse until real backend is ready for use). Though, according to me both has it's pros and cons,either of them is good enough to start your front development work in most cases. Do share your experiences if any in comments or in email

If you are new to Postman,JSON Server etc do refer my blogs.Links below

1)Basics Of JSON Server
2) Customizing JSON Server
3) Postman Mock Server Basics
4) Postman Mock Server- Getting API Key
5) Creating API through Postman

JSON Server

JSON Server is a command line tool and super easy to use even for people who don’t spend most of the day at their terminals. You can get a full fake REST API with zero coding in less than 30 seconds (seriously). It all comes down to letting you serve JSON from your file system via a local server.

Pros
  • Easy to setup
  • The dummy data is in your version control system
  • It supports the most used HTTP verbs
  • Biggest advantage according to me is that you can add dynamic values and thats lasts until JSON mock server is restarted. That means,it saves changes to you JSON source for PUT,POST,DELETE,PATCH requests
Cons
  • Needs node,npm installed on your machine
  • Easy for developers, but not for others as they still need some level of programming knowledge
  • No user interface
  • Maintainability of one single JSON file for your responses

Postman mock server

You can also create mock server using Postman. Let's look at the Pro's and Cons of this approach

Pros
  • Again,Easy to setup
  • Easy to use for anyone including non programming individuals
  • Great tool-works well
  • Has an User interface with lot of useful features like viewing History,Collections,Collaborating tools etc
  • Sharing with others easier
Cons
  • Need to register with your credentials on POSTMAN website
  • Can’t add dynamic values like in JSON server. Only way is to hardcode the response for each url/endpoint.To differentiate each example, there should be definitely some uniqueness in URL or request body or headers
  • CORS limitations may be an issue
  • Your data is stored on third party public servers that you don’t own
  • Dependency on vendor, in this case Postman
  • Data is not in your version control system

And that's it. Hope you undertood the difference between Postman's mock server and JSON server. Each has it own pros and cons like anything else .Just use the appropriate one based on your needs.Email me at "techspacedeck@gmail.com" incase you have queries. Alternatively, you can fill the "CONTACT" form or drop a comment below

Did you like the blog or have questions, please add your comments