I use cloud9 as my IDE and I cant preview anything running on any port other than 3000.
I was using npm run develop instead of gatsby develop.
I'm trying to do the same thing. I tried to change the port by entering "gatsby develop -p 8080" but it did not work cloud9 says there's no app running at 8080. The npm run develop also did not work.
Same issue
Note that if you use gatsby serve -p 8080
after building, then it does work on c9 ide
For anyone still trying, the solutions is to include also the host as a flag, like this:
$ gatsby develop -p $PORT -H $IP
reference link: https://www.gatsbyjs.org/docs/gatsby-cli/#develop
Most helpful comment
For anyone still trying, the solutions is to include also the host as a flag, like this: