serve -s build specify port number
20,205
From typing serve --help
, I found
-l, --listen listen_uri
Specify a URI endpoint on which to listen
For TCP ports on hostname "localhost":
$ serve -l 1234
In your case, you can just use
serve -l 3000 -s build
to specify that you want to serve the app on port 3000
Author by
rma
Updated on July 09, 2022Comments
-
rma almost 2 years
I'm trying to serve a react-app's build folder from a DigitalOcean droplet.
After I run
yarn build
, I get told by the script to runyarn global add serve serve -s build
However, when I run
serve -s build
, It say's it's running on http://localhost:5000. I would like it run on localhost:3000 instead, as I have another server running on port 5000. How can i specify the port number such thatserve -s build
runs on port 3000?