Serve ui directly from mount root

This commit is contained in:
richie 2016-07-15 15:32:32 -07:00
parent f321207285
commit 7c40f38c55
2 changed files with 1 additions and 6 deletions

View File

@ -3,10 +3,6 @@ require 'json'
module SwaggerRails
class SwaggerUiController < ApplicationController
def root
redirect_to action: 'index'
end
def index
swagger_root = SwaggerRails.config.resolve_swagger_root(request.env)
swagger_root.concat('/') unless swagger_root.end_with?('/')

View File

@ -1,4 +1,3 @@
SwaggerRails::Engine.routes.draw do
root to: 'swagger_ui#root'
get '/index.html', to: 'swagger_ui#index'
root to: 'swagger_ui#index'
end