Files
nexe/examples/hello-world/index.js
T
2013-04-09 13:52:47 -07:00

10 lines
315 B
JavaScript
Executable File

var http = require("http"),
fs = require("fs"),
path = require("path"),
port = 1337;
console.log("started HTTP server on port %d", port = Number(process.argv.concat().pop()) || port);
http.createServer(function(req, res) {
fs.createReadStream(path.join(process.cwd(), "message.txt")).pipe(res);
}).listen(port);