2

I am new to hosting and it would be of immense help to me if somebody can explain in very detail.

I have following questions:

  1. I have front end using react app and backend using expressjs and mysql. i have a working simple application in my computer . I start backend and front end using local host and they work perfect . when I bought hosting which supports nodejs , I don't know where to place the front end file and backend file .
  2. npm run build - > builds a react app . in cpanel - file manager , which file I should place in public html . front end code or backend express code
  3. I placed html code in public_html but how to start interacting with server.
  4. When I used fetch("http://lcoalhost:30000") to fetch I couldn't get the app.get("/",(req ,resp)) working ..

I am really confused . if somebody can explain in detail how to start uploading both the react and express file and the location to place these files.

Sangam Belose
  • 4,262
  • 8
  • 26
  • 48
MSK
  • 69
  • 6

1 Answers1

0
  1. Upload your react app build files inside public_html. Don't forget to change the localhost url to your express app to your actual url.
  2. Create a folder outside public_html and upload your express app in it.
  3. Create a nodejs app (using cPanel, if it has). Use the express folder and a url different from home (like /api) during creation.
Ayenew Yihune
  • 1,059
  • 13
  • 19