Good news; Cloud9 IDE now works

JerseyFoo

1/g = g-1
Reaction score
40
For those of you who [should've] tried Cloud9 months ago when it was released and couldn't make sense of it; it now works. I feel this is a necessary announcement as Cloud9 was telling everyone it was working, and a bunch of BS bloggers also claimed it was great -- when it was obviously not functioning at a sane level. I even wrote the team and told them to hire someone who knew JavaScript, and they assured me they already have. Ridiculous. Please don't give them money.

Why Cloud9 is important? It allows you to develop Node.js apps on Windows without too much pain.
 

JerseyFoo

1/g = g-1
Reaction score
40
I used it quite a bit yesterday. The editor is not working well, lot of bugs and annoyances, but functioning.

PHP:
var http = require('http'), fs = require('fs'), util = require('util');
var mime = {html: 'text/html', css: 'text/css', js: 'text/javascript'};

http.ServerResponse.prototype.send = function(source, status){
    this.writeHead(status || 200, this.headers);
    this.end(source);
};
http.ServerResponse.prototype.error = function(e){
    this.send('<pre class="error">' + e + '</pre>', 500);
};

function hListen(Q,R){
    // derp
    
}

function hPost(Q,R){
    var body = '';
    request.on('data', function(chunk){
        body += chunk;
    });
    request.on('end', function(){
        var data = JSON.parse(body);
        
    });
}

function hFile(Q,R){
    function cb(e, source){
        if (e) 
            R.error(e.stack);
            
        R.send(source);
    }
    
    fs.readFile( Q.filename, 'utf8', cb);
}

http.createServer(function(Q, R){
    var handler = hFile;
    var m;
    var ext = (m = Q.url.match(/\.([a-z]+)$/)) && m[1] || 'html';
    
    Q.filename = Q.url.substr(1) || 'index.html';
    R.headers = {
        'Content-Type': mime[ext],
        'X-Powered-By': 'poo'
    };
    
    if ( Q.url.indexOf('/mc/') !== -1 ){
        handler = Q.method == 'POST' ? hPost : hListen;
    }
    
    if ( Q.method == 'POST' ){
        handler = hChatMsg;
    } else 
    
    handler(Q,R);
}).listen(process.env.C9_PORT, '0.0.0.0');
 

JerseyFoo

1/g = g-1
Reaction score
40
Update Node.js now works on Windows, so Cloud9 is completely useless. Sorry for not noticing this earlier!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top