change port react app 1

change port react app

//in package.json

"start": "react-scripts start"
"start": "PORT=3006 react-scripts start"
"start": "export PORT=3006 react-scripts start"
"start": "set PORT=3006 && react-scripts start"

Here is what the above code is Doing:
1. We’re importing the createServer function from the http module.
2. We’re importing the readFile function from the fs module.
3. We’re creating a server using the createServer function.
4. We’re telling the server what to do when someone tries to access the server.
5. We’re telling the server to listen for requests on port 3000.

Similar Posts