summaryrefslogtreecommitdiff
path: root/config/routes.rb
diff options
context:
space:
mode:
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