forked from openware/peatio
-
Notifications
You must be signed in to change notification settings - Fork 7
/
config.ru
19 lines (17 loc) · 631 Bytes
/
config.ru
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
require 'rack/cors'
map Rails.application.config.relative_url_root do
use Rack::Cors do
allow do
origins CORS::Validations.validate_origins(ENV['API_CORS_ORIGINS'])
resource '/api/*',
methods: %i[get post delete put patch options head],
headers: :any,
credentials: ENV.true?('API_CORS_ALLOW_CREDENTIALS'),
max_age: CORS::Validations.validate_max_age(ENV['API_CORS_MAX_AGE'])
end
end
run Peatio::Application
end