diff options
author | gebele <gebele@in-silico.ch> | 2017-06-08 11:31:45 +0000 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2017-06-08 11:31:45 +0000 |
commit | 31eccd98440dd9b28580ae9e1961ab738dc79823 (patch) | |
tree | 87fc9a5b0e8d315a5ef582b600b114094c9ba9dd | |
parent | 9335ef164b7a291cdee0bd23f9c1bf189cacd09b (diff) |
update for sinatra cors and swagger in one image
-rw-r--r-- | lib/swagger.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/swagger.rb b/lib/swagger.rb new file mode 100644 index 0000000..916439e --- /dev/null +++ b/lib/swagger.rb @@ -0,0 +1,8 @@ +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 |