How do I upload my ReactJS or Angular application to my hosting account?
To be able to view, from your domain, a web page made in ReactJS follow these steps:
1. Add the homepage to your package.json file
Open your React application. Then, open the package.json file and add a “homepage” attribute like this:

The format should be "homepage": "https://midominio.com"
2. Create the build of your application
- In the root directory of your application, run the command
yarn installto install the updated dependencies. - Once that has finished, run the command
yarn build(npm installandnpm buildalso work). - You will notice that this creates a new directory in your project called build. The build directory is, basically, a compressed version of your app that contains everything your browser needs to identify and run your application.

3. Upload the contents of the build directory to the main web directory in your hosting account.
The next step is to upload the contents of the build directory you created in the previous step to the main directory of your website. Using the File Manager in the control panel, or by connecting via FTP.
In the case of a cPanel account, the directory would be public_html.
In the case of a Plesk account, the directory would be httpdocs.
This is an example of the directory structure of a cPanel account, where you will see the public_html directory.

And this is an example of the directory structure of a Plesk account, where you will see the httpdocs directory.

This is an example of the typical files you will see in your build directory, which you should upload to public_html, httpdocs or the main directory of your website.
.png)
4. Create the .htaccess file
For routes to work in your React application, you will need to add a .htaccess file.
You should create this file in the public_html, httpdocs or the main directory of your website, at the same level as the contents of the build directory you uploaded earlier.
Edit the file and insert the following basic information:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]
</IfModule>
Then, save the changes to the file.
That’s it!
Now you can use your domain in the browser and you should see your fully functional web application.