diff options
author | rautenberg <rautenberg@in-silico.ch> | 2016-04-04 16:17:41 +0200 |
---|---|---|
committer | rautenberg <rautenberg@in-silico.ch> | 2016-04-04 16:17:41 +0200 |
commit | e3284e859455db4e773d1005ff8ecdb87a6233b1 (patch) | |
tree | d62c274450cc651a941d02fdf7b9262fcaf6000b | |
parent | bbc00c1206a5ec068df6ba643791e039d34ee926 (diff) |
set automated host in api
-rw-r--r-- | api/api.json | 2 | ||||
-rw-r--r-- | application.rb | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/api/api.json b/api/api.json index cfcc2f3..5672f64 100644 --- a/api/api.json +++ b/api/api.json @@ -187,7 +187,7 @@ }, "post": { "tags": [ - "algorithm", + "compound", "descriptor" ], "summary": "Descriptor calculation", diff --git a/application.rb b/application.rb index 32a0fb4..8535a9f 100644 --- a/application.rb +++ b/application.rb @@ -24,7 +24,9 @@ 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) - File.read(api_file) + api_hash = JSON.parse(File.read(api_file)) + api_hash["host"] = request.env['HTTP_HOST'] + return api_hash.to_json end |