I have created a basic React App from https://www.tutorialspoint.com/reactjs/reactjs_jsx.htm here , I want to run this test code on Apache based server, I know that I need t
Before making the npm build,
1) Go to your React project root folder and open package.json.
2) Add "homepage" attribute to package.json
if you want to provide absolute path
"homepage": "http://hostName.com/appLocation",
"name": "react-app",
"version": "1.1.0",
if you want to provide relative path
"homepage": "./",
"name": "react-app",
Using relative path method may warn a syntax validation error in your IDE. But the build is made without any errors during compilation.
3) Save the package.json , and in terminal run npm run-script build
4) Copy the contents of build/ folder to your server directory.
PS: It is easy to use relative path method if you want to change the build file location in your server frequently.