Hacker News new | past | comments | ask | show | jobs | submit login

Sinatra is definitely an interesting project. We recently "ported" it to JavaScript:

http://github.com/tlrobinson/jack/blob/030685ef3de4c29c38b4e...

The same webservice would be:

    roundabout.route({ path:"/add/{a}/{b}", get: function(){this.body = this.wildcards["a"] + this.wildcards["b"];} })
or, alternatively:

    roundabout.get("/add/{a}/{b}", function(){ this.body = this.wildcards.a + this.wildcards.b; });
The first syntax is a tad longer, but its much more useful; you can define any method with the name of an HTTP verb for that path, and you can also define a filter parameter that will be queried before the path is matched. The filter lets you do whatever pre-processing you want, so you could filter out requests from a specific user-agent for example, or all URLs that use mixed case, or anything else you can think of.



That looks really cool; how's that been working out? Is that in production? If Ruby had Gambit Scheme's serializable continuations, that would be pretty interesting times.


We're not yet using it in production, its only a few weeks old, but we will be in some of the things we're working on.

One of the main benefits is letting us run objective-j and cappuccino on the server, letting us share application data models in the client and the server.




Consider applying for YC's first-ever Fall batch! Applications are open till Aug 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: