M
M
Mors Clamor2019-10-10 18:04:04
Yii
Mors Clamor, 2019-10-10 18:04:04

How to connect the site and RESTful API correctly?

Introduction.
Hello. After such a cannonade of questions, I’ll reveal my goal: I need to make a “mini social network for my own people” (20 people), preferably with a chat and beautiful buns, but this is already a matter of technology. I did it on Codeigniter 3, it's quite simple, but when there is already a lot of code, it became wildly inconvenient. Decided to learn Yii. I learned a lot of new things for myself, you helped, thank you.
I decided to make the essence
of the site from 2 parts - a RESTful API that would do everything related to working with entities and a database (users, their data, posts, likes, etc.) and the actual client part that would work with this API.
Problems
Of course, there are a whole bunch of them, but they are all generated from one thing - ignorance of how right it really is.
Do I understand correctly that the very interaction with the API should still take place on the server side, and not on the client side (as I thought)?
And what else would you advise from the height of your experience when implementing such a project?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Ruslanov, 2019-10-10
@66demon666

You misunderstand the term API.
Your definition:
Wiki definition:
What I want to say with this: API is a layer between the user and the server. An example is the keyboard. It provides an interface, and the computer is already processing the data and outputting the result, depending on what you pressed (whether it was a combination of keys, a switch key, etc.)
Answering the question:
No way. An interface should be implemented, not bound.
How to do it?
Start a server, start an application, write code.
Works? You start implementing the interface by standardizing http communication between the client-server.
ps: I hope that more knowledgeable people will correct and supplement my answer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question