Skip to content

Instantly share code, notes, and snippets.

@alice1017
Created June 17, 2011 14:16
Show Gist options
  • Save alice1017/1031495 to your computer and use it in GitHub Desktop.
Save alice1017/1031495 to your computer and use it in GitHub Desktop.
sample nodejs script
var html = require("html");
var base_header = new Object({
"Content-Type":"text/html;charset=utf-8"
});
var server = html.createServer();
server.on("request",function(req,res){
res.writeHead(200,base_header);
res.end("it works");
});
server.listen(8080, "localhost");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment