Skip to content

Instantly share code, notes, and snippets.

@falsecz
Created October 18, 2012 15:10
Show Gist options
  • Save falsecz/3912460 to your computer and use it in GitHub Desktop.
Save falsecz/3912460 to your computer and use it in GitHub Desktop.
facebookUser = app.require 'facebook/user'
app.use methodBodyParser
app.use streamBodyParser
app.method 'xxxx', (req, res) ->
# probehlo body parserem
app.callFacebookUser ....
facebookUser {id: 234324}, (err, data) ->
stream = facebookUser (res) ->
res.on 'data'
res.on 'error'
stream.
res.data
app.stream 'str', (req, res) ->
req.on 'error', ->
req.on 'line', (string) ->
req.on 'object', (object) ->
# prisel mi object
res.object {}
....
res.end()
throw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment