Maybe I should have made this more clear.
Here is the thing,
Since the client and the server are two different things, they also run on two different ports.
When you do create-react-app, by default your app (client) will run on port 3000 where as for the server, we choose to run it on port 5000
Great article!
Small typo though (sorry) ...
In all the example code you've used port 5000 but then, near the end of the article, it says:
"After your React app runs, you should see it at localhost:3000."
Maybe I should have made this more clear.
Here is the thing,
Since the client and the server are two different things, they also run on two different ports.
When you do
create-react-app
, by default your app (client) will run onport 3000
where as for the server, we choose to run it onport 5000
Thanks Mustafa. Apologies, I jumped the gun and hadn't tested it for myself first. 🤦♂️
I've run through the process now and did find that the following command doesn't work:
npm create-react-app my_app
The "npm" should be "npx". i.e:
npx create-react-app my_app
For npm use the following command:
npm init react-app my_app
Source: github.com/facebook/create-react-app
Once again, great article!
you are so right. I meant type
npx
. Thanks again!