Rest


Create a simple rest API service


$ yarn global add json-server


$ cd app/api
$ json-server --watch db.json --port 3001

http://localhost:3000/entries/


db.json


{
  "entires": [
    {
      "id": 1,
      "description": "Work income reducer",
      "value": 1000.0,
      "isExpense": false
    },
    {
      "id": 2,
      "description": "Water bill reducer",
      "value": 20.0,
      "isExpense": true
    },
    {
      "id": 3,
      "description": "Rent reducer",
      "value": 300.0,
      "isExpense": true
    },
    {
      "id": 4,
      "description": "Power bill reducer",
      "value": 50.0,
      "isExpense": true
    }
  ]
}


Example


Application with a good example 1 - JS


Building Strongly Typed REST Clients with Typescript - Jose Manuel Heredia Hidalgo, Microsoft