Answer the question
In order to leave comments, you need to log in
Is it worth it to start developing a site right away with the API?
The idea is to write an API for the site right away. Well, for example, select 10 news items in the required format:
for this, we make a GET request and format get=news&limit=10&type=json
it as we please.
As a result, we get 10 news in the json array with the necessary information. I see some advantages from such a development - for example, you can change the framework or even the language without touching the frontend.
Is this design approach applicable? And maybe there are ready-made solutions that you can read about. Or are there some significant downsides that I'm not aware of?
Answer the question
In order to leave comments, you need to log in
for example, you can change the framework or even the language without touching the frontend.In most cases, you can change the framework without touching the frontend. For example, if your framework uses the "Twig" template engine. In some cases, it is also possible to change the language by subjecting the templates to minimal modification, which can be done via "Find/Change". But, if I were you, I would not flatter myself too much on this "opportunity".
Well, for example, select 10 news in the desired format,Usually a POST request is made, and not in the format of the address bar (GET parameters), but is sent in the same way, a request in JSON format. Notice the keyword "usually", ie. not always .
make a GET request
Is this design approach applicable?It's more of a development approach, client-server level, and/or REST API.
And maybe there are ready-made solutions that you can read about.It is not entirely clear what kind of ready-made solution you want to receive. HTTP clients and JSON data processing built into many languages, or implemented as ready-made libraries.
Or are there some significant downsides that I'm not aware of?If you want to develop, for example, a desktop or phone (as an example) client application, then this is one of the best options. If you want to build a normal site according to this principle, then you will simply introduce a new level of abstraction and a new link in the chain, which will complicate the work for yourself, as well as potentially slow down the project.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question