Swagger documentation not available when subdomain
Asked Answered
S

0

7

Using the grape-swagger gem, I've setted a subdomain on Grape Swagger as such in routes.rb

constraints subdomain: /api/ do
  mount Api::V1::Base => '/'
end

And here is document.rb

require 'grape-swagger'

module API
  class Root < Grape::API
    mount API::Cats

    add_swagger_documentation
  end
end

However, when I go to http://api.localhost:3000/swagger_doc , I get a routing error

No route matches [GET] "/swagger_doc"

If I remove the constraints, I can access to http://localhost:3000/swagger_doc .

I tried to add a base_path parameter to add_swagger_documentation but to no avail.

Any hint on what I might have done wrong ?

Samarskite answered 5/11, 2015 at 16:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.