|
|
@@ -5,24 +5,7 @@ run Sinatra::Application
|
5
|
5
|
|
6
|
6
|
use Rack::Cors do
|
7
|
7
|
allow do
|
8
|
|
- origins /http:\/\/localhost:\d{1,3}(:\d+)?/, '127.0.0.1:3000',
|
9
|
|
- /http:\/\/192\.168\.0\.\d{1,3}(:\d+)?/
|
10
|
|
- # regular expressions can be used here
|
11
|
|
-
|
12
|
|
- resource '/file/list_all/', :headers => 'x-domain-token'
|
13
|
|
- resource '/file/at/*',
|
14
|
|
- :methods => [:get, :post, :put, :delete, :options],
|
15
|
|
- :headers => 'x-domain-token',
|
16
|
|
- :expose => [ 'Access-Control-Allow-Origin' => '*',
|
17
|
|
- 'Access-Control-Allow-Methods' => 'POST, PUT, PATCH, DELETE, GET, OPTIONS',
|
18
|
|
- 'Access-Control-Request-Method' => '*',
|
19
|
|
- 'Access-Control-Allow-Headers' => 'Origin, X-Requested-With, Content-Type, Accept, Authorization'],
|
20
|
|
- :max_age => 600
|
21
|
|
- # headers to expose
|
22
|
|
- end
|
23
|
|
-
|
24
|
|
- allow do
|
25
|
8
|
origins '*'
|
26
|
|
- resource '/*', :headers => :any, :methods => :get
|
|
9
|
+ resource '*', :headers => :any, :methods => :get
|
27
|
10
|
end
|
28
|
11
|
end
|