mauricemach/zappa — Issue #107: Using client-side routes with zappa/sammy
Author: Hudon689
Created: 2011-11-05 04:13:37+00:00
State: open

[Zappa Docs](http://zappajs.org/docs/0.3-gumbo/reference/) say that you can do @ get, post, put, del in browser-side code (section "CLIENT-SIDE ROOT SCOPE"). Looking around the docs, and then at the source (0.3.1), I see zappa is exposing Sammy's routing functionality to do so.
Only @ get is being exposed though, so:

@client '/foo.js': ->
@get '#/': ->
alert 'bar'
@post '#/banana': ->
alert 'ban'

@ post will throw an error as soon as it is read: "Uncaught TypeError: Object #