Question

I am trying to run a production server. Almost everything is working but the documentation with Apipie does not work perfectly.

When I am in a development environment, everything is fine. But on production, Apipie does not find my documentation while my doc is written on each controller.

I think that is because Apipie is load before API controllers but I am not sure.

initializer/apipie.rb

Apipie.configure do |config|
  config.app_name = "MyApi"
  config.api_base_url  = "/api"
  config.doc_base_url = "/Apidoc"
  config.validate = false
  config.layout = "api"
  config.markup = Apipie::Markup::Markdown.new
  config.reload_controllers = true if (Rails.env.development?)
  config.api_controllers_matcher = File.join(Rails.root, "app", "controllers", "api", "**","*.rb")
  config.app_info = <<-DOC
    This is where you can inform user about your application and API
    in general.
  DOC
end

Gemfile.rb

gem 'apipie-rails'
gem 'maruku'

I am using Rails 4, Ruby 2.1, Apipie-Rails 0.0.22, Maruku 0.7.1

If anyone has an idea to unblock me, it would be very nice ! Thank you in advance.

Edit : I have created an issue on the github repository and it seems to be a problem coming from the gem itself

Was it helpful?

Solution

There is a solution here. I hope this will help someone else.

You just have to set your GemFile with the current repo and made the following modification on your initializer of Apipie :

config.reload_controllers = true

Like that, controllers are reloaded on every environments.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top