From 2f52a92c67b5ae0ce01a9cacdc41bf9ae92c3e2a Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Wed, 4 Nov 2015 14:04:13 -0500 Subject: [PATCH] Constrain API to the api subdomain --- config/routes.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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