0

I use cloud9 locally and i would like to be able to configure the port when running my node server (because i am using socket.io on the client side and it's not convenient to have to update the path after each starts).

I have seen that we can start the server with command line, i guess there is something to do with that but i didn't find anything on node -help

Ludo
  • 5,060
  • 15
  • 53
  • 85

2 Answers2

0

When connecting with socket.io in the browser, just do io.connect(location.host). location.host will automatically be the hostname:port from which the current web page was served, thus no need to ever change that regardless of deployment. I'm not familiar with cloud9 in particular, but in node web servers, you explicitly specify the port to listen on when calling server.listen(port, optionalIP).

Peter Lyons
  • 142,938
  • 30
  • 279
  • 274
0

start the cloud9 ide server like this:

bin/cloud9.sh -l 0.0.0.0 -p 3232 
bnuhero
  • 2,734
  • 1
  • 19
  • 16