config/routes.rb in phcpress-53.1.0 vs config/routes.rb in phcpress-54.0.0
- old
+ new
@@ -1,25 +1,25 @@
Phcpress::Engine.routes.draw do
- # Mount Accounts Engine
- mount Phcaccounts::Engine, :at => '/'
+ # API Routes
+ namespace :api, :path => "", :constraints => {:subdomain => "api"} do
+ namespace :v1 do
+ resources :posts, defaults: {format: 'json'}
+ resources :categories, defaults: {format: 'json'}
+ end
+ end
- # Application Articles
+ # Article Routes
namespace :article do
resources :categories, class_name: 'Phcpress::Articles::Category'
resources :posts, class_name: 'Phcpress::Articles::Post'
end
- # Application FrontEnd
+ # Frontend Routes
namespace :blog do
resources :articles, only: [:index, :show]
end
- # Application API
- namespace :api do
- namespace :v1 do
- resources :posts, defaults: {format: 'json'}
- resources :categories, defaults: {format: 'json'}
- end
- end
+ # PHCAccounts Routes
+ mount Phcaccounts::Engine, :at => '/'
end