diff options
author | gebele <gebele@in-silico.ch> | 2018-01-30 14:15:09 +0000 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2018-01-30 14:15:09 +0000 |
commit | 909b34b31d71671b5e5a660cb78b5f1bc1a88b8b (patch) | |
tree | 06e6b516beac441c331e6cf932fbc226fd001430 | |
parent | 63ca78ca7a2e60b080ae58667ebe9a4f245e409e (diff) | |
parent | 12f88bf241f653936cb3ed959a989cb71eca47f0 (diff) |
Merge remote-tracking branch 'origin/ORN' into development
-rw-r--r-- | config.ru | 3 | ||||
-rw-r--r-- | lib/api.rb | 4 | ||||
-rw-r--r-- | lib/swagger.rb | 4 |
3 files changed, 5 insertions, 6 deletions
@@ -1,5 +1,4 @@ -SERVICE = "lazar-rest" require 'bundler' Bundler.require require File.expand_path './lib/lazar-rest.rb' -run Sinatra::Application
\ No newline at end of file +run Sinatra::Application @@ -2,8 +2,8 @@ get "/api/api.json" do response['Content-Type'] = "application/json" api_file = File.join("api", "api.json") - bad_request_error "API Documentation in Swagger JSON is not implemented.", uri("/#{SERVICE}/api") unless File.exists?(api_file) + bad_request_error "API Documentation in Swagger JSON is not implemented." unless File.exists?(api_file) api_hash = JSON.parse(File.read(api_file)) api_hash["host"] = request.env['HTTP_HOST'] return api_hash.to_json -end
\ No newline at end of file +end diff --git a/lib/swagger.rb b/lib/swagger.rb index f6b42b2..9fa14f7 100644 --- a/lib/swagger.rb +++ b/lib/swagger.rb @@ -2,7 +2,7 @@ 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) + index_file = File.join(ENV['HOME'],"swagger-ui/dist/index.html") + bad_request_error "API Documentation in Swagger JSON is not implemented." unless File.exists?(index_file) File.read(index_file) end |