Before you can use json-server , you must have and npm installed on your computer.
To , you use the Node Package Manager (npm) rather than downloading a standalone installer. This powerful, lightweight library allows you to spin up a full mock REST API in seconds using a simple JSON file as your database. Prerequisites for Installation
: On macOS or Linux, you might need to use sudo npm install -g json-server for permission. 2. Local Installation (Recommended for Projects)
Installing globally allows you to run the json-server command from any directory on your system. : npm install -g json-server
Once downloaded, follow these three steps to get your server running: JS - Mocking a REST API with JSON Server - DEV Community