

Ask HN: Best framework to develop a web API - digamber_kamat

I just received a task of building a web based stock market simulator. I am only supposed to write the algorithms and expose them as an API.(web based, something like RESTful ). My client will then just hand this over to people who will develop good looking front-end, iPhone, blackberry apps and so on for it.<p>This is the first time I am building an API as such but I have done a lot of web programming in PHP and Python.<p>I am wondering which would be the best framework to build such an API. Or should I build the business logic in one and expose it to the rest of the world in something lightweight such as NodeJS ?<p>Please suggest me frameworks and basic approaches. Even links to pointers will be highly appreciated.
======
jjhageman
You can build an API in any common language. Since you are already comfortable
in PHP or Python, your time will be best spent using one of those languages.
I'm guessing your client will be expecting the product some time soon. =)

I would recommend structuring it as a RESTful web service though.

------
bphogan
I like Sinatra (Ruby) for APIs. If the URL structure needs more complexity,
Rails is better, but the downside is that you're getting a lot more than what
you might need.

If I were asked to do one in Python, I'd use Flask.

------
kookiekrak
I would suggest Ruby on Rails.

I'm in the process of developing an accurate blackjack simulator with RoR.

~~~
digamber_kamat
Can rails handle HTTP PUT , DELETE requests with equal ease the way it does
POST and GET ?

~~~
jjhageman
Yes. Example of how the code could look in RoR:

[http://davidwparker.com/2010/03/09/api-in-rails-respond-
to-a...](http://davidwparker.com/2010/03/09/api-in-rails-respond-to-and-
respond-with/)

