summaryrefslogtreecommitdiff
path: root/config/routes.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-04-08 14:22:56 +0200
committerAzul <azul@leap.se>2014-04-08 14:30:07 +0200
commit9776dd10fc60efde38946588d0955c406f6c1f5e (patch)
treea77a83984e39a72cd1bb2f8f89c6d9646de117d7 /config/routes.rb
parentb6d14dc19dd350a807826e3e097738a36613e083 (diff)
move users: config and lib
Diffstat (limited to 'config/routes.rb')
-rw-r--r--config/routes.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/config/routes.rb b/config/routes.rb
index f8bb8fb..05eca9b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -16,4 +16,31 @@ LeapWeb::Application.routes.draw do
end
get '/provider.json' => 'static_config#provider'
+
+ namespace "api", { module: "v1",
+ path: "/1/",
+ defaults: {format: 'json'} } do
+ resources :sessions, :only => [:new, :create, :update]
+ delete "logout" => "sessions#destroy", :as => "logout"
+ resources :users, :only => [:create, :update, :destroy, :index]
+ resources :messages, :only => [:index, :update]
+ end
+
+ scope "(:locale)", :locale => MATCH_LOCALE do
+ get "login" => "sessions#new", :as => "login"
+ delete "logout" => "sessions#destroy", :as => "logout"
+
+ get "signup" => "users#new", :as => "signup"
+ resources :users, :except => [:create, :update] do
+ # resource :email_settings, :only => [:edit, :update]
+ # resources :email_aliases, :only => [:destroy], :id => /.*/
+ post 'deactivate', on: :member
+ post 'enable', on: :member
+ end
+ end
+
+ get "/.well-known/host-meta" => 'webfinger#host_meta'
+ get "/webfinger" => 'webfinger#search'
+ get "/key/:login" => 'keys#show'
+
end