public
anonymous / gist:4465656
Created

node server

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
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;

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.