fake api server code example
Example 1: json server
json-server --watch db.json
Example 2: 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 3: how to create fake api server
npm install --save-dev json-server
This install json-server to work as a fake api