Skip to content

Instantly share code, notes, and snippets.

@DarrylDias
Created December 25, 2013 09:13
Show Gist options
  • Save DarrylDias/8121611 to your computer and use it in GitHub Desktop.
Save DarrylDias/8121611 to your computer and use it in GitHub Desktop.
Hello World! written in nodeJS
/* This will display Hello World! on client's web browser.
The code below will not show up in the source. Only "<strong>Hello World!</strong>" will be visible in source.
*/
var http = require('http');
http.createServer(function (req,res) {
res.writeHead(200, {'Content-Type:' 'text/html'});
res.end('<strong>Hello World!</strong>');
}).listen(80, '0.0.0.0');
console.log('Web Server running on port:80 on server ip');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment