diff --git a/README.md b/README.md index 687bcf8..ae9eb98 100644 --- a/README.md +++ b/README.md @@ -186,6 +186,7 @@ Run `rails test` to run the full test suite. This API can be deployed to [Heroku](https://heroku.com/) with the following commands (assuming you have the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) installed): ```bash $ heroku create +$ git push heroku master $ heroku run bundle exec rails db:schema:load $ heroku open ``` diff --git a/config/application.rb b/config/application.rb index bdd07da..e2bcb38 100644 --- a/config/application.rb +++ b/config/application.rb @@ -26,5 +26,12 @@ class Application < Rails::Application # Middleware like session, flash, cookies can be added back manually. # Skip views, helpers and assets when generating a new resource. config.api_only = true + + config.middleware.insert_before 0, Rack::Cors do + allow do + origins '*' + resource '*', :headers => :any, :methods => [:get, :post, :options] + end + end end end