Last active
August 29, 2015 14:19
-
-
Save kopasetik/530894626c23c17d845c to your computer and use it in GitHub Desktop.
Node snippet on Cloud9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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