Created
August 26, 2014 09:27
-
-
Save ando-takahiro/9aa364cd0079f1ab6c8d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ts = require('tail-stream'); | |
| require('http').createServer(function (req, res) { | |
| res.writeHead(200, { | |
| 'Content-Type': 'text/plain' | |
| }); | |
| var stream = ts.createReadStream(req.url.substr(1), { | |
| detectTruncate: true, | |
| onTruncate: 'end', | |
| endOnError: false | |
| }); | |
| stream.pipe(res); | |
| }).listen(8000); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
save above file as app.js
$ curl http://localhost:8000/app.js to see
$ echo "//test" >> app.js