Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReactJS (create-react-app) run on port 80 [duplicate]

Can somebody explain how to run my reactJS app on port 80, without specifying port

currently it works on www.mydomain.com:3001 but I want it to be visible when I go to www.mydomain.com

I can't find the solution on create-react-app docs website so I'm asking here.

If I run application with

sudo npm start

I get error that something is already using port 80 (I did specify PORT= 80)

Thanks

like image 645
ii7scw Avatar asked Feb 13 '18 07:02

ii7scw


1 Answers

you have to specify PORT env variable to run on port 80 PORT=80 npm run start

like image 163
habibi07 Avatar answered Oct 23 '22 03:10

habibi07