Skip to content

Instantly share code, notes, and snippets.

@MhdSyrwan
Forked from anonymous/index.js
Created October 14, 2012 17:31
Show Gist options
  • Save MhdSyrwan/3889267 to your computer and use it in GitHub Desktop.
Save MhdSyrwan/3889267 to your computer and use it in GitHub Desktop.
var server=require('./server')
server.start();
var http=require('http')
function start(){
var onrequest=function(req,res){
res.writeHead(200,{'Content-Type':'text/plain'})
res.write('hello,world!')
res.end()
}
var server=http.createServer(onrequest)
server.listen(process.env.PORT, process.env.IP)
console.log('done')}
exports.start=start;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment