updated example

This commit is contained in:
Craig Condon
2013-04-09 13:52:47 -07:00
parent ddea854649
commit b78cea8c35
3 changed files with 6 additions and 4 deletions
+1
View File
@@ -0,0 +1 @@
Hello World!!!
+4 -4
View File
@@ -1,10 +1,10 @@
var http = require("http"),
fs = require("fs"),
path = require("path"),
port = 1337;
console.log(process.argv);
console.log("started HTTP server on port %d", 1337);
console.log("started HTTP server on port %d", port = Number(process.argv.concat().pop()) || port);
http.createServer(function(req, res) {
res.end("Hello World!!");
fs.createReadStream(path.join(process.cwd(), "message.txt")).pipe(res);
}).listen(port);
+1
View File
@@ -0,0 +1 @@
hello world!