Skip to content

Instantly share code, notes, and snippets.

@kopasetik
Last active August 29, 2015 14:19
Show Gist options
  • Save kopasetik/530894626c23c17d845c to your computer and use it in GitHub Desktop.
Save kopasetik/530894626c23c17d845c to your computer and use it in GitHub Desktop.
Node snippet on Cloud9
var
http = require("http"),
path = require("path"),
fs = require("fs"),
express = require('express');
var app = express();
var server = http.createServer(app);
app.get('/', function(res,req){
console.log('success!');
res.send('sent request to the homepage');
});
server.listen(process.env.PORT || 3000, process.env.IP || "0.0.0.0", function(){
var addr = server.address();
console.log("Codejabber listening at", addr.address + ":" + addr.port);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment