summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-03-30 15:38:50 -0700
committerelijah <elijah@riseup.net>2016-03-30 15:38:50 -0700
commitbd5ffce445fd91eac32ac1309297e7e3cf05ead8 (patch)
tree4d107eea848fd3501e049b3b73f81cf7b1ce7595 /config
parent9a8577a2d19aa51318dce6ff9ffe1bd26f25c09e (diff)
api: added json error pages, allow "." in the :id param of all api routes
Diffstat (limited to 'config')
-rw-r--r--config/routes.rb5
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]