Can’t write the end points in JSON server db.json file

  angular, json, json-server

I am using a JSON server in angular. I need an API like http://localhost:3000/logs/services/collector/event. In my db.json file

{
"logs" :{
    "services": {
      "collector" : {
        "event": {
          "text": "Success", "code": 0
        }
      }
    }
  }
}

I need to get the resources of JSON like logs/services/collector/event to get the response as

{
 "text": "Success", "code": 0
}

But I am not getting it. How to write the endpoint for that?

Thanks In advance

Source: Angular Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.