I. Installing Node.
js
1. Download the latest version of [Link] Installer here.
2. Run the installer.
3. Follow the installer steps, and click the next button. Finally, click the Install button to run the
installer. When it finishes, click Finish.
4. Restart your system/machine.
5. At last, verify whether you have properly installed [Link] in your window, run the following
command in “Command Prompt”:
type node -v command, the system should display the [Link] version installed on your system.
type npm -v command, the system should display the NPM version installed on your system.
II. Installing JSON Server
1. Create a folder, for example: “d:\api-mocker”
2. Open “[Link] Command prompt”, and go to the folder by running command cd /d D:\ api-
mocker
3. Run command npm init , it will take a while to process, press Enter for everything. Finally, enter
‘yes’ for last step. It will create [Link] file in your folder. (You are creating a new project
here)
4. Run command npm install json-server , this will install and add json-server as a package into your
project
5. Next step is creating a database file. You create a <file-name>.json that stores the data of the
mock database in JSON format. Let’s add some data to the file. For example, let’s name the file
[Link].
6. Open “[Link]” file. In “scripts” key, add "start": "json-server --watch [Link]"
7. Run command npm run start -- for starting the server, and it will load data from [Link]
When it finished, you should have the Mock REST API running at [Link]