npm json-server

Hello guys, currently i am using fake api of npm json-server. How can i create a custom endpoint because in my db.json i have nested object array and i want to have an endpoint to the child array of my db.json because i only have endpoint to the parent object array

I'm Noob, correct me if i use wrong term

{
  "users": [
    {
      "id": 1,
      "name": "John",
      "age": 30,
      "posts": [
        {
          "id": 101,
          "title": "First Post",
          "content": "This is the content of the first post."
        },
        {
          "id": 102,
          "title": "Second Post",
          "content": "This is the content of the second post."
        }
      ]
    },
    {
      "id": 2,
      "name": "Alice",
      "age": 25,
      "posts": [
        {
          "id": 103,
          "title": "Another Post",
          "content": "This is another post by Alice."
        }
      ]
    }
  ]
}
Was this page helpful?