1
0
Fork 0

Merge branch 'atomaka/bugfix/staging-api' into 'master'

Allow api subdomain on staging to work too

in staging, the subdomain becomes 'api.staging' and 'api' will not match. We can resolve this with a regex: `/^api(\.|$)/`.

There is a configuration setting, `config.action_dispatch.tld_length` that could resolve this as well.  Typically, I imagine this being set by environment, but since Heroku suggests running all Rails apps as production, even if it is a different environment, this isn't really an option.

See merge request !24
This commit is contained in:
Andrew Tomaka 2015-11-04 14:20:31 -05:00
commit 3a80191239

View file

@ -29,7 +29,7 @@ Rails.application.routes.draw do
resources :versions, only: [:show]
end
constraints subdomain: 'api' do
constraints subdomain: /^api(\.|$)/ do
namespace :api, path: nil do
namespace :v1 do
resources :cards, only: [:index, :show]