How to create a fake demo RESTful API

https://egghead.io/lessons/javascript-creating-demo-apis-with-json-server

 

 https://github.com/typicode/json-server

 

npm i -g json-server

 

 

npm i -g json-server
or

npx json-server db.json --watch db.json



//db.json 

{ "people: [ 
     { 
     "id": 0,
     "name": "John"
     } 
   ] 
}

 

json-server db.json

 

 

 

 

This makes an endpoint:     http://localhost:3000/people

 



Watch the video to see how to use Javascript to create the XML database... very cool.