Skip to content

Instantly share code, notes, and snippets.

@leafsummer
Created July 7, 2015 10:04
Show Gist options
  • Save leafsummer/28e17af58ade82fcdd67 to your computer and use it in GitHub Desktop.
Save leafsummer/28e17af58ade82fcdd67 to your computer and use it in GitHub Desktop.
nodejs, create a simple http server
var http = require('http');
http.createServer(function(req, res){
res.wirteHead(200, {'Content-Type': 'text/html'});
res.wirte('<h1>Node.js</h1>');
res.end('<p>Hello World</p>');
}).listen(3000);
console.log("HTTP Server is lisetening at port 3000.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment