Skip to content

Instantly share code, notes, and snippets.

@tim-smart
Forked from manveru/listenpost.coffee
Created June 28, 2010 04:37
Show Gist options
  • Save tim-smart/455454 to your computer and use it in GitHub Desktop.
Save tim-smart/455454 to your computer and use it in GitHub Desktop.
router.post('/save').
bind (req, res, next) ->
body: new Buffer(parseInt(req.headers['content-length']))
offset: 0
req.addListener 'data', (chunk) ->
length: chunk.length
chunk.copy(body, offset, 0, length)
offset += length
req.addListener 'end', ->
p body.toString('ascii')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment