The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

hettlage (136) [Avatar] Offline
#1
When I start json-server with the db.json file content given in Listing 1.1, I get an error:

Data must be an object. Found object.See https://github.com/typicode/json-server for example.


It seems that you have to modify the content to be an object:

{
  "tasks": [
    {
      "title": "Learn Redux",
      "description": "The store, actions, and reducers, oh my!",
      "status": "Unstarted"
    },
    {
      "title": "Peace on Earth",
      "description": "No big deal.",
      "status": "Unstarted"
    },
    {
      "title": "Create Facebook for dogs",
      "description": "The hottest new social network",
      "status": "Completed"
    }
  ]
}

Marc Garreau (28) [Avatar] Offline
#2
You are very right. We'll get that fixed for the next release. Thanks!