Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ gem 'thin'
gem 'puma'
gem 'http'
gem 'webrick'
gem 'rack-cors'
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ GEM
rack (2.2.6.4)
rack-accept (0.4.5)
rack (>= 0.4)
rack-cors (2.0.1)
rack (>= 2.0.0)
rack-protection (3.0.5)
rack
rake (13.0.6)
Expand Down Expand Up @@ -114,6 +116,7 @@ DEPENDENCIES
http
minecraft_items
puma
rack-cors
rake
rspec
sinatra
Expand Down
8 changes: 8 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
$:.unshift "app/"

require 'minecraft_api'
require 'rack/cors'

use Rack::Cors do
allow do
origins 'http://localhost:3000'
resource '*', headers: :any, methods: [:get, :post, :put, :patch, :delete, :options]
end
end

run MinecraftApi