Stack Overflow Asked by Dawit Mesfin on January 18, 2021
I am new to web development. When I read how to setup react project I see localhost:3000. I searched for it but any of the answers didn’t answer what localhost:3000 mean.
To make you understand this you should understand that you need a web server to host the application to run on the web. Then it will be available for most of the people.
But that application needs to be developed somewhere. In this case you need a local server. There are several local server instances like IIS, Wamp, Xampp and nodejs.
If you are getting started with react then you most probably using react app development with its cli creat-react-app or in short CRA. With this structure and configuration of this app, it is hosted locally in node server and on port 3000.
So, to answer your question. localhost is the address which denotes to 0.0.0.0
or 127.0.0
and it chose the port 3000
you can configure it to other ports too.
So, when you type http://localhost:3000
in the addressbar of the browser you can see the first page hosted from your app. You can make use of etc/hosts file to a local name just like http://localhost:3000 to http://localapp.me
too.
Answered by Jai on January 18, 2021
So as analogy think your computer as home and ports are room numbers that you have at home.
So your react app is living at 3000. room when you run npm start
Answered by Ubeyt Demir on January 18, 2021
localhost 3000 is the default port that runs on your computer for react app. you can change it anytime in the package.json
Answered by Orbb92 on January 18, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP