Skip to content

Instantly share code, notes, and snippets.

@timwis
Created August 7, 2016 16:53
Show Gist options
  • Save timwis/c40214aaf5abd883d3d1251f67e30ed8 to your computer and use it in GitHub Desktop.
Save timwis/c40214aaf5abd883d3d1251f67e30ed8 to your computer and use it in GitHub Desktop.
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