blob: c7b84aa338ba4adbd66a6c292f2b64a5b9af3eb7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
set :public_folder, File.join("/home/ist/swagger-ui/dist/")
# route to swagger API file
get "/?" do
response['Content-Type'] = "text/html"
index_file = File.join("/home/ist/swagger-ui/dist/index.html")
bad_request_error "API Documentation in Swagger JSON is not implemented.", uri("/#{SERVICE}/api") unless File.exists?(index_file)
File.read(index_file)
end
get "/swagger/?" do
redirect to("/")
end
|