Answer the question
In order to leave comments, you need to log in
How to write a backend for a react spa project?
I am writing an online store for a portfolio in react, now I need to write rest api back in php. The problem is that some say you need to create another project and through my project do ajax to the goods page, for example, another project I created example.com/goods to get a list of products and both projects are separate on the hosting, while others say create a folder in the rest project and there is a file php to take a list of products from the database, for example, and through ajax take the data from the file. I don't understand how to do it. And if when we take the data, we should not in the form of ready-made html, but in json format, and write html on the front?
Answer the question
In order to leave comments, you need to log in
For data - json.
For content - html.
The script is one, but with different types of responses. Also, it can be mounted on different route-points for ease of use.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question