diff options
author | elijah <elijah@riseup.net> | 2016-03-30 15:38:50 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2016-03-30 15:38:50 -0700 |
commit | bd5ffce445fd91eac32ac1309297e7e3cf05ead8 (patch) | |
tree | 4d107eea848fd3501e049b3b73f81cf7b1ce7595 /config/routes.rb | |
parent | 9a8577a2d19aa51318dce6ff9ffe1bd26f25c09e (diff) |
api: added json error pages, allow "." in the :id param of all api routes
Diffstat (limited to 'config/routes.rb')
-rw-r--r-- | config/routes.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/config/routes.rb b/config/routes.rb index c455dd7..e370aa4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -26,9 +26,10 @@ LeapWeb::Application.routes.draw do namespace "api", { module: "v1", path: "/1/", - defaults: {format: 'json'} } do - resources :sessions, :only => [:new, :create, :update], + defaults: {format: 'json'}, :constraints => { :id => /[^\/]+(?=\.json\z)|[^\/]+/ } + } do + resources :sessions, :only => [:new, :create, :update] delete "logout" => "sessions#destroy", :as => "logout" resources :users, :only => [:create, :update, :destroy, :index, :show] resources :messages, :only => [:index, :update] |