Created
June 17, 2011 14:16
-
-
Save alice1017/1031495 to your computer and use it in GitHub Desktop.
sample nodejs script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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