Created
February 8, 2012 08:35
-
-
Save jedahan/1766804 to your computer and use it in GitHub Desktop.
beginning zappa
This file contains 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
require('zappa') -> | |
@enable 'default layout' | |
@get | |
'/card/:read_id': -> | |
cards.findOne {read_key: @params.read_id}, (err, card) => | |
@next if !card? | |
@render map: {card} | |
'/card/:write_id': -> | |
cards.findOne {write_key: @params.write_id}, (err, card) => | |
@next if !card? | |
@render mark: {card} | |
'/card/:bad_id': -> | |
"Invalid card #{@params.bad_id}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment