Skip to content

How to run a create-react-app based project on a specific port? #11732

Answered by harshcut
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

You can specify a environment variable named PORT to specify the port on which the server will run.

PORT=4000

If you don't want to set the environment variable, another option is to modify the scripts part of package.json.

"start": "set PORT=4000 && react-scripts start"

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant