How to connect to a machine on Cloud9?

56 views Asked by At

I opened an account on Cloud9 and I ran some code successfully. I got the following output in the console:

Your code is running at https://****1986.c9users.io.
Important: use process.env.PORT as the port and process.env.IP as the host in your scripts! Debugger listening on port 15454
listening on port 3000

The code is:

var express = require('express');
var app = express();

app.get('/', function(req,res) {
    res.send("OK");
});

app.listen(process.env.PORT, function() {
    console.log("listening on port " + process.env.PORT);
});

So after running it, I opened my browser and surfed to: https://***1986.c9users.io:3000 I would expect to get a "OK" in the browser, but it seems that the browser can't reach this destination.

What address do I have to type so I can connect my Cloud9 server?

1

There are 1 answers

0
CrazySynthax On

Probably, Cloud9 has a problem with running files inside directories. This file was placed inside the directory 'server' (when I couldn't access the address by the browser). Once I put it in the main directory, I could connect it by applying to https://***1986.c9users.io (without port number)