F
F
Fantomer2020-11-08 15:24:55
PHP
Fantomer, 2020-11-08 15:24:55

How to quickly build a React project for debugging?

Situation: a React web application makes ajax requests to a web server (everything is in php). The problem is that I can’t write js without errors right away, I have to build the project several times (npm run build), and this takes a couple of minutes - a long time, in short. Then I copy it to the local server folder and check what happened to me. And if you run npm start, then php is not processed there (does everything work on nodejs inside?). So how can I quickly check everything so as not to build this project for a long time?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Antonio Solo, 2020-11-08
@Fantomer

make the react client run locally (npm start) and write the paths to your (local) server where the PHP site lives. It is possible (most likely) that you will either have to enable CORS on the php backend, or disable the ban on CORS in the browser

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question