Skip to content

Instantly share code, notes, and snippets.

@jakswa
Created May 28, 2011 16:45
Show Gist options
  • Save jakswa/997020 to your computer and use it in GitHub Desktop.
Save jakswa/997020 to your computer and use it in GitHub Desktop.
CLOUD9IDE WOOO
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"
type="text/javascript"></script>
<script type="text/javascript">
$().ready(function() { $("#btnn").click(function() {
$.get("http://hellonode.jakswa.cloud9ide.com",
function(data) {
$("body").html(data);
}
);
});});
</script>
</head>
<body>
Gonna put stuff here dynamically from<br />
a server running with the source in<br />
server.js! EXCITED?<br />
<div id="holder"></div>
<button id="btnn" type="button">Click?</button>
</body>
</html>
//runs on Cloud9's Node.js service
//this is pretty much the 'hello world' from http://nodejs.org/
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain', 'Access-Control-Allow-Origin': '*'});
res.end('Hello World\n');
}).listen(process.env.C9_PORT, "0.0.0.0");
console.log('Server running on port' + process.env.C9_PORT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment