In this example, want to run a react application I created and publish it to the web using my domain, or maybe I just want to run it on my locals server using XAMPP apachefriends for example without a node.js server but an apache server running PHP? So for this example below, I have XAMPP installed and I want to run my react application into the following url:

http://localhost/REACT/TESTING/reactapp/build/

First, lets create a blank application in windows folder where I have xampp installed and open a terminal into the TESTING folder:

F:\apachefriends\xampp\htdocs\REACT\TESTING 

Command to create the new app:

$ npx create-react-app reactapp

Next, cd into the newly created app:

$ cd reactapp

OPTIONAL: You can open the new application in Visual Code

$ code .

Open the package.json file and add the following property after "name"

 "homepage""REACT/TESTING/reactapp/build/",

Now we can make our build:

$ npm run build

Open the application in your browser:

http://localhost/REACT/TESTING/reactapp/build/