diff --git a/config/routes.rb b/config/routes.rb index 3d9b626..c5dd020 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -29,10 +29,12 @@ Rails.application.routes.draw do resources :versions, only: [:show] end - namespace :api do - namespace :v1 do - resources :cards, only: [:index, :show] - resources :links, only: [:index, :show] + constraints subdomain: 'api' do + namespace :api, path: nil do + namespace :v1 do + resources :cards, only: [:index, :show] + resources :links, only: [:index, :show] + end end end end