api/config/application.rb
require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Kidsboards
class Application < Rails::Application
# Libs
config.autoload_paths += %W(#{config.root}/lib)
# CORS
config.middleware.insert_before 0, Rack::Cors do
allow do
origins '*'
resource '*', :headers => :any, :methods => [:get, :post, :delete, :put, :patch, :options, :head]
end
end
end
end