REST API route pattern

0

I am creating an application similar to Twitter using Laravel and React, where the database has the tables: Post, User, Relation, Mention and Repost. In the 'timeline' screen of the application will be displayed information of all the tables of my bank.

My question is, I build a / timeline route for React to pick up all the information on a single route, or on the timeline screen it should consume all the necessary routes (/ etc...)?

    
asked by anonymous 09.03.2018 / 14:31

1 answer

0

In the frontend, you are going to make HTTP requests to get the information you need for the user interface. No matter how the method of getting the information is implemented in the backend. What is required should be required through an HTTP request.

There can be only one request, it can be many. It depends on how the backend is built. It's up to you if you want to create a unique route to your React application. If your view is an API that will become public, it might not be a good idea. I think your question fits into the good practice theme to build an API. If it were me, I would leave the backend API modularized for each feature, regardless of which frontend to use it.

    
09.03.2018 / 18:46