Created
April 7, 2013 11:29
-
-
Save abesto/5330111 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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