mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 07:16:40 +00:00
Serve ui directly from mount root
This commit is contained in:
parent
f321207285
commit
7c40f38c55
@ -3,10 +3,6 @@ require 'json'
|
|||||||
module SwaggerRails
|
module SwaggerRails
|
||||||
class SwaggerUiController < ApplicationController
|
class SwaggerUiController < ApplicationController
|
||||||
|
|
||||||
def root
|
|
||||||
redirect_to action: 'index'
|
|
||||||
end
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
swagger_root = SwaggerRails.config.resolve_swagger_root(request.env)
|
swagger_root = SwaggerRails.config.resolve_swagger_root(request.env)
|
||||||
swagger_root.concat('/') unless swagger_root.end_with?('/')
|
swagger_root.concat('/') unless swagger_root.end_with?('/')
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
SwaggerRails::Engine.routes.draw do
|
SwaggerRails::Engine.routes.draw do
|
||||||
root to: 'swagger_ui#root'
|
root to: 'swagger_ui#index'
|
||||||
get '/index.html', to: 'swagger_ui#index'
|
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user