-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use with only a subset of controllers? #1
Comments
We are going to add a config.api_only! option inside config/application.rb so if you add this config middleware stack will be reduced and if not you keep previous state. After that you will be able to just inherit from ActionController::API. Anyway I'm interested in seeing if that worth, I mean how much that improves. If you can measure it and share results :). Ahh another thing, there's no Rails::ApiApplication anymore, the README is fixed now. |
The idea behing the config is that it will reduce your middleware stack and reconfigure some generators to not generate stuff like templates and assets - css/js. In case of shared apps, this option cannot be used because you'll lose features like session/cookies, which are required for the non-api part of your app. So the best usage in this case is inheriting from (of course this is not possible right now because everything is happening inside normal |
OK, so I got my API working by just using |
You're getting the benefit of having a smaller set of features in your controllers that handle the API part of your app, which should give you some improvement, but the middleware stack stays the same, so yeah no gain on that side. We can't say for sure the real gain on this scenario, perhaps you can help us measuring this :). Thanks. |
@ileitch can you check this out?, thanks! |
…fault middleware stack Closes rails-api#1
merge other junk into mine
My API is contained within a larger Rails app. They all inherit from a common parent class, so I can easily change them to use
ActionController::API
, however I'm unsure what to do about theRails::ApiApplication
setup step?Cheers
The text was updated successfully, but these errors were encountered: