Skip to main content

Command Palette

Search for a command to run...

Setup a Fake Rest-API in 5 steps

Updated
โ€ข1 min read
Setup a Fake Rest-API in 5 steps
V

I am a Full Stack Developer from Mumbai, India. Currently I'm pursuing my Bachelors in Computer Science.

Step 1 :

Initialize your npm project with npm init -y command

Screenshot (500).png

Step 2 :

Install the "json-server" package using npm i json-server

Screenshot (501).png

Step 3 :

Create a file with .json extension and write your data in JSON format

Screenshot (503).png

Step 4 :

Enter the package.json folder and write "script: "json-server --watch database.json"

image.png

Step 5 :

Run the npm run json command in the terminal

Screenshot (505).png

aaannndd...

Screenshot (506).png Click on http://localhost:3000/People

Hope I helped ๐Ÿ˜Š Bye ๐Ÿ‘‹