summaryrefslogtreecommitdiff
path: root/users/config/routes.rb
blob: 9a7c531306a773dec9efe8f8bead9a6cb02f4cde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Rails.application.routes.draw do

  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]
    get "user_messages/:user_id" => "messages#user_messages"
    put "mark_read/:user_id/:message_id" => "messages#mark_read"
  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