use scotty framework
create dsl for routes, write once, generate client and server side libs
SURF means _method=SURF (with GET real verb), this will mean send the metadata for this url instead of the whole html rendered
post /posts/:name GET SURF PUT DELETE
posts /posts POST
foobar /foo/bar/:car/:dar GET
needs to generate a list of javascript regexps to match on clientside and figure out which route it matches...
also needs to be able to call the route by name w/ arguments to render it for anchors
for example, i can call (in coffeescript):
uri.post.render({name: 'bob'}) => '/posts/bob'
uri.post.render('bob') => '/posts/bob'
uri.posts.render() => '/posts'
uri.foobar.render({car: '1', dar: '2'}) => '/foo/bar/1/2'
uri.foobar.render('1','2') => '/foo/bar/1/2'
$(defineHandler "foobar") $ \params -> do
let car = (params `lookup` "car")
dar = (params `lookup` "dar")
text (car ++ "," ++ dar)
will have to delve into TH a little bit to learn how to grab metadata from dsl to create scotty routes
vagrant box add precise64 http://files.vagrantup.com/precise64.box