Created
January 6, 2013 06:39
-
-
Save anonymous/4465656 to your computer and use it in GitHub Desktop.
node server
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'); | |
var port = process.env.PORT || 4000; | |
function start(){ | |
function onRequest(req, res){ | |
res.writeHead(200, {"Content-Type": "text/plain"}); | |
res.write("FortuneFold"); | |
res.end(); | |
} | |
var server = http.createServer(); | |
server.on('request', onRequest); | |
server.listen(port, function(){ | |
if(process.send){ | |
process.send('listening'); | |
} | |
}); | |
console.log('Server listening on port 4000'); | |
} | |
exports.start = start; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment