Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Whoa whoa whoa guys, timeout! I thought Rails enforced REST conventions on all your models and therefore Gives You An API For Free? Wasn't that its big selling point? Or of adhering to REST in general?


Rails doesn't enforce anything - but it does encourage you to follow a RESTful style (not necessarily REST itself).

But the point of this is to strip out the defaults in Rails that are included because they are convenient in full-blown apps, that aren't needed in apps that only serve APIs (reducing bloat and probably making things faster). How much of an issue those things are in a real application will vary.

From the article:

> we can remove many parts of Rails that aren't important in an API context: many middleware don't make sense, and all of ActionView can go away

...

> Similarly, the structure of ActionController::Base is interesting: it includes a ton of modules that implement various features. This means that we can build an alternate 'controller stack' that doesn't include all of the ones that are in Base.




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

Search: