blob: c43151fcc05e83f6b0489106280af914d135dc29 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
include OpenTox
require 'rack/cors'
set :show_exceptions => false
# add CORS support for swagger
use Rack::Cors do |config|
config.allow do |allow|
allow.origins '*'
allow.resource "/#{SERVICE}/*",
:methods => [:head, :get, :post, :put, :delete, :options],
:headers => :any,
:max_age => 0
end
end
before do
@accept = request.env['HTTP_ACCEPT']
response['Content-Type'] = @accept
end
[
"api.rb",
"compound.rb",
"dataset.rb",
"model.rb",
"substance.rb",
"validation.rb"
].each{ |f| require_relative f }
|