-
Notifications
You must be signed in to change notification settings - Fork 278
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
Possible to API-ify namespace only? #209
Comments
I was thinking the same, is there a possibility to use rails-api stack on a namespaced resource ? |
I am having the same problem with a setup very much like the one @brianlittmann has. When including rails-api gem, devise starts to complain because of the lack of flash middleware on the stack. There doesn't seem to be a way to have two middleware stacks, each for the right controller. Seems to be a rack limitation but the documentation should be completely straightforward about this to avoid people losing time. Seems like I will avoid rails-api gem for a better solution, maybe using ActionController::Metal. |
Hi all, any news about this issue? |
@alexdesi I compromised and just had a root API module controller that inherited from |
I've been doing a bit of reading on approaches to this, but nothing really stood out. It's a pretty common setup:
The simplest approach is just a single app with different namespaces for each, but with that comes all of the default Rails middleware on the API side even if its controllers inherit from
ActionController::API
, right?So is it possible to have a custom application.rb and conditionally load certain middleware on the
api/
namespace only? Or is it an all or none thing, where I either use an engine for my main app code and share it across multiple Rails apps (one for the admin, one for the API) or wrap all the namespaces under one big red bow and have an API operating under a full/default Rails stack (regarding middleware, not controller modules)?The text was updated successfully, but these errors were encountered: