Open alexander-lopez-s opened 2 years ago
I did not undertand what is the meaning of the numbers in between brackets. http://localhost:1337/api/products?fields[0]=name&fields[1]=price If i change [0] for [1234], i get the same data, i don't know why we need those numbers.
Is Strapi nowadays the most used headless CMS by companies?
Is it recommendable to use Strapi for designing API? I mean, the whole content of the website will be created dynamically with JS, is this a good practice? Or can we just use Strapi to manage specific elements of our webpage?
When I close my laptop, my local server stops to work and I must type npm ci in the console to make the server run again. I wonder how can I fix this problem.
The complex queries are very complex.
- If i change [0] for [1234], i get the same data, i don't know why we need those numbers.
well that's the way Strapi is written :) you do need to differentiate between the fields, as it is an array..so they can't have the same number
- Is Strapi nowadays the most used headless CMS by companies?
it is popular, but not sure how you can measure that
- Is it recommendable to use Strapi for designing API? I mean, the whole content of the website will be created dynamically with JS, is this a good practice? Or can we just use Strapi to manage specific elements of our webpage?
yes, that is why we have this module :) only that content will be dynamic that we want, definitely not the entire app. the content that can change constantly or often, or that needs to be generated interactively based on user input..is what can be dynamically generated into HTML
- When I close my laptop, my local server stops to work and I must type npm ci in the console to make the server run again. I wonder how can I fix this problem.
well, that is expected. you are emulating, simulating a server on your local machine. if you close it, it stops. but instead of npm ci, you should be able to just run npm run develop
week2?
Week 2
So, once we have our chat API model designed and created in Strapi, how can we implement functionalities such us loging in, storing passwords, creating unique usernames, etc? Do we need hel from any other programming language?
I am not sure I understood relations. What is the reference that we take to determine a relation type? Let's say we are designing a restaurant. Price and Products have a relation, but what tells me that the relation is one-to-many or many-to-one? Why is this useful?
This was a very busy week for me but was able to at least understand the basics of Strapi and how to retrieve data from the server.
Week 3
THANK YOU!
- how can we implement functionalities such us loging in, storing passwords, creating unique usernames, etc? Do we need hel from any other programming language?
we have covered Auth since then, do you still have questions about it? everything is possible with JS ;)
- Price and Products have a relation, but what tells me that the relation is one-to-many or many-to-one? Why is this useful?
well, you have to think about the relation type, in order to be able to create a useable database that can store and fetch information in a sensible way
- PostMan helps us retrieve a API and if we give permissions, edit it or delete it.
Postman is good for testing an API, the various request types of GET, POST, etc.
2. guess I need to understand better how the token works for authenticated users to able to log in.
I have explained it in Slack to Maria, have you seen it?
3. I want to display the messages from the sender in the right side and the receiver in the left side but I cannot figure it out.
take a look at CSS flexbox for positioning
- I need a refresher to use DELETE method. I tried but it did not work. I want to make a button that once clicked, it could delete messages from my app. I cannot find any JS function on the internet that could give me an idea.
my first assumption is that only authorized users can delete anything from the database.. so probably you have to provide a Bearer JWT token in the header of the request.
headless cms
Learning goals