From f0edd9641ade6d27f9cef58e767346e02011ef0c Mon Sep 17 00:00:00 2001 From: laurenfb Date: Wed, 21 Dec 2016 11:03:39 -0800 Subject: [PATCH 1/2] added line in deployment instructions for missing step --- README.md | 1 + 1 file changed, 1 insertion(+) 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 ``` From dbf0d36246ef12151e6b5dafec99923d6991c7ad Mon Sep 17 00:00:00 2001 From: laurenfb Date: Wed, 21 Dec 2016 12:54:33 -0800 Subject: [PATCH 2/2] hopefully fixing the no access control thing --- config/application.rb | 7 +++++++ 1 file changed, 7 insertions(+) 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