How to run json-server in windows? (ok)

https://stackoverflow.com/questions/54442398/how-to-run-json-server-in-windows

Installing JSON Server

 npm install -g json-server
npx json-server db.json

JSON File

// db.json
{
  "employees": [
    {
      "id": 1,
      "first_name": "Sebastian",
      "last_name": "Eschweiler",
      "email": "sebastian@codingthesmartway.com"
    },
    {
      "id": 2,
      "first_name": "Steve",
      "last_name": "Palmer",
      "email": "steve@codingthesmartway.com"
    },
    {
      "id": 3,
      "first_name": "Ann",
      "last_name": "Smith",
      "email": "ann@codingthesmartway.com"
    }
  ]
}

Running The Server

json-server --watch db.json

Last updated