Answer the question
In order to leave comments, you need to log in
Deal with the API?
Hello. I'm trying to build a react app. It should work with the API. There is no documentation. There is only a list of methods.
I don't understand how to work.
The API has a method for obtaining a token (authorization). But then this token is not involved in any of the following methods.
What to do with this token? (can be stored in cookies or local storage)
How will the server understand that I am authorized on the next request?
Thank.
Answer the question
In order to leave comments, you need to log in
Judging by the link provided in the comments, bearer authentication is used there.
Having received the token after authorization, pass it in the request headers in the form:
Authorization: Bearer awesome-token-12345
This is how the server will understand who exactly the request is coming from
https://swagger.io/docs/specification/authenticati...
Two tables are not needed in this case. Absolutely useless, senseless and merciless overengineering. You are just tormented to do LEFT JOIN with and without a reason, and maintain the integrity of such a bundle.
First of all, you need to optimize so that it is easier to work. And only then, when it works, and if it slows down, then and only then optimize performance.
And if there are only 40k records in the table, then this will not slow down (unless you run the database on the calculator) and small performance problems will be solved by a competent arrangement of indexes in the table.
If TIME is real time, then one table, if a limited non-expandable list ("morning", "afternoon", "evening", "night") - one table with ENUM, if an expandable list, then two tables.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question