typicode json server code example

Example 1: json server

json-server --watch db.json

Example 2: json-server

#Install JSON Server
npm install -g json-server

#Start JSON Server
json-server --watch db.json

Example 3: json server

npm install -g json-server

Example 4: dummy api json

var xhr = new XMLHttpRequest();
xhr.open("GET", "https://reqres.in/api/products/3", true);
xhr.onload = function(){
    console.log(xhr.responseText);
};
xhr.send();

Example 5: json server

{
  "posts": [
    { "id": 1, "title": "json-server", "author": "typicode" }
  ],
  "comments": [
    { "id": 1, "body": "some comment", "postId": 1 }
  ],
  "profile": { "name": "typicode" }
}

Tags:

Misc Example