S
S
Speakermen2021-12-29 15:38:46
API
Speakermen, 2021-12-29 15:38:46

How to design api?

How to design api. For example, there is a layout https://webmarce.com/html/musicbeat/index-two.html it has several components

Menu
Slider
Block Recent Releases
Block Tour Schedule
Block Our Gallery
Block Upcoming Events
Block Latest Albums
Block Our Band Members
Footer

Me separately address

return this.menuService.findAll(); 
return this.sliderService.findAll();
return this.recent Service.findAll(); // limit 3
...


And throw on the client for example

data: [
Menu : {},
Slider: {},
Block Recent Releases: {}
]


or 1 service and all join is a thread ? I didn't have this json anymorereturn this.homeService.findAll();


[
  {
    "userId": 1,
    "id": 1,
    "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
    "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
  },
  {
    "userId": 1,
    "id": 2,
    "title": "qui est esse",
    "body": "est rerum tempore vitae\nsequi sint nihil reprehenderit dolor beatae ea dolores neque\nfugiat blanditiis voluptate porro vel nihil molestiae ut reiciendis\nqui aperiam non debitis possimus qui neque nisi nulla"
  },
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WapSter, 2021-12-29
@Speakermen

Can be split into several.
Let's say general information is loaded when the front is initialized: menu, footer.
The rest can be paginated.
In general, there is a nest-crud library that
knows how to split by entities and you can make a selection from the front

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question