From 3a11ba2918795821600b7113d0758415718d263a Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 11 Jun 2018 12:46:06 +0200 Subject: combine gui with rest --- lib/swagger.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 lib/swagger.rb (limited to 'lib/swagger.rb') diff --git a/lib/swagger.rb b/lib/swagger.rb new file mode 100644 index 0000000..efe1c9d --- /dev/null +++ b/lib/swagger.rb @@ -0,0 +1,6 @@ +get "/" do + response['Content-Type'] = "text/html" + 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 -- cgit v1.2.3