SM Mizan

Instant Create Mock JSON CRUD API

Prerecuite software install

Visual Studio

Node js

JSON Server Setup

npm install -g json-server

Then VS Code using create a file like db.json

{
    "persons":[
        {
            "id":1,
            "name":"aman",
            "age":20
        },
        {
            "id":2,
            "name":"Rakib",
            "age":25
        }
    ],

    "Book":[
        {
            "id":1,
            "bookname":"Sea Life",
            "price":25.30
        },
        {
            "id":2,
            "name":"Life of Pie",
            "age":11.20
        }
    ]
}

Run the Server

json-server --watch db.json

May be not run json server , PSSecurityException/UnauthorizedAccess need to allow

windows power shell run as administrator mode

Set-ExecutionPolicy -Scope CurrentUser RemoteSigned

then press Y

now you can run json server again

json-server --watch db.json

Now you can just try it postman GET Request

Post Request

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top