Permalink
Browse files

fs.createReadStream() example

  • Loading branch information...
substack committed Aug 28, 2012
1 parent d3ba806 commit 5df0fbf191fca03bf2ce4042a3c32dae58feb498
Showing with 11 additions and 0 deletions.
  1. 0 example/{server.js → filed.js}
  2. +11 −0 example/read_stream.js
File renamed without changes.
View
@@ -0,0 +1,11 @@
+var oppressor = require('../');
+var fs = require('fs');
+var http = require('http');
+
+var server = http.createServer(function (req, res) {
+ fs.createReadStream(__dirname + '/data.txt')
+ .pipe(oppressor(req))
+ .pipe(res)
+ ;
+});
+server.listen(8000);

0 comments on commit 5df0fbf

Please sign in to comment.