Search code examples
ruby-on-railsswaggergrape-api

rails : grape-swagger-rails API request with http instead of https in swagger documentation


The API is hosted on https. When I try to request the API, the request is made to http instead of https which gives error result.

Mixed Content: The page at .... ....was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint

How to set it to make request on https instead of http.


Solution

  • I found that I have not set base_path in base.rb To solve this problem we need to add

    add_swagger_documentation base_path: "https://ssl.domain.com"