-
Notifications
You must be signed in to change notification settings - Fork 508
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
Handling nested Grape mounts? #2156
Comments
The So the easy fix for that is obviously: diff --git a/api/base.rb b/api/base.rb
index dd5fd3a..9519b43 100644
--- a/api/base.rb
+++ b/api/base.rb
@@ -1,3 +1,5 @@
+require_relative "v1"
+
module Aurora
module API
class Base < Grape::API It might break the reloader, but I am not sure if the reloader will even work for Grape applications. |
@adam12 Ah, that was a relatively easy fix... Though I'm now seeing routes listed twice... |
I'm not sure how much help I'll be there sadly. |
Hi @farcaller, I've setup an example app under https://github.com/wikimatze/padrino-nested-grape-mounts which do the nesting in a way I understand modules in grape as explained under https://github.com/ruby-grape/grape#modules - just follow the README in https://github.com/wikimatze/padrino-nested-grape-mounts/blob/master/README.md to see what I did. |
I'm trying to use Grape for providing 'versioned' APIs with Padrino.
I'd like to just mount a single
API
class in Padrino, e.g.:Padrino.mount('API', :app_file => Padrino.root('api/base.rb'), :app_class => 'API::Base').to('/api')
Which then mounts the version APIs.
However whenever I try this I get an 'Unitialized Constant' error.
Further details can be found here: https://groups.google.com/forum/?nomobile=true#!topic/padrino/9aA5wFpWp4k and here: fatmcgav/padrino-grape-example@0e3a6c6
The text was updated successfully, but these errors were encountered: