How to run ReactJs project on server without having port

Viewed 422

Firstly, I'm sorry for my English grammar...

Okay, so I already run my react on the website, but when I type the site URL in the address bar, I need to even put :3000 after the URL. If it's running on-site, I don't want to put the port on the URL. Can anyone help me on how to run react without the port number in the deployed site?

it should look like this... example.site.com not like example.site.com:3000

If you need any details to tell me in the comments. THANKS IN ADVANCE!!!

1 Answers

Did you run npm run build and take the "build" folder that is generated and copied that folder to your server? If you did it, its not a React problem/configuration, it's an server configuration, and depends of the server your are using. Nginx is a popular one. If you don't run npm run build and you put all your project code on the server, and you are running that code with npm start then you are doing it your deployment in the wrong way.

Related