require File.expand_path('config/environment', __dir__)

<% if app_orm == 'activerecord' -%> use OTR::ActiveRecord::ConnectionManagement <% end -%>

use Rack::Cors do

allow do
  origins '*'
  resource '*', headers: :any, methods: [ :get, :post, :put, :delete, :options ]
end

end

use Rack::Static,

root: File.expand_path('./swagger-ui', __dir__),
urls: ["/swagger"],
index: 'index.html'

run API::Base