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
30
31
32
33
34
35
|
require "sinatra"
require "../lazar/lib/lazar.rb"
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
[
"aa.rb",
"api.rb",
"compound.rb",
"dataset.rb",
"feature.rb",
"model.rb",
"nanoparticle.rb",
"substance.rb",
"validation.rb"
].each{ |f| require_relative f }
|