Created
August 7, 2016 16:53
-
-
Save timwis/c40214aaf5abd883d3d1251f67e30ed8 to your computer and use it in GitHub Desktop.
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
const http = require('http') | |
const Readable = require('stream').Readable | |
const formBody = require('body/form') | |
http.createServer(function (req, res) { | |
const stream = new Readable | |
console.log('inbound') | |
formBody(req, {}, (err, body) => { | |
stream.push('hi') | |
stream.push(null) | |
}) | |
stream.pipe(res) | |
}).listen(8080) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment