Skip to content

Instantly share code, notes, and snippets.

@abesto
Created April 7, 2013 11:29
Show Gist options
  • Save abesto/5330111 to your computer and use it in GitHub Desktop.
Save abesto/5330111 to your computer and use it in GitHub Desktop.
app.post '/tab', (req, res) ->
redis.incr 'tab', (err, id) ->
return res.send 500, err if err
key = tabKey(id)
json = JSON.stringify {id: id, text: req.body.text}
redis.set key, json, (err) ->
return res.send 500, err if err
redis.rpush tabsListKey, id, (err) ->
return res.send 500, err if err
res.send 201, json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment