forked from hotsh/rstat.us
-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.rb
64 lines (52 loc) · 2.89 KB
/
routes.rb
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
RstatUs::Application.routes.draw do
root :to => "static#homepage", :constraints => lambda {|x| x.session[:user_id] == nil}
root :to => "updates#timeline", :constraints => lambda {|x| x.session[:user_id] != nil}
# Sessions
resources :sessions, :only => [:new, :create, :destroy]
match "/login", :to => "sessions#new"
match "/logout", :to => "sessions#destroy"
match "/follow", :to => "static#follow", :via => :get
# Static
match "contact" => "static#contact"
match "about" => "static#about"
match "open_source" => "static#open_source"
match "help" => "static#help"
# External Auth
# If we add more valid auth providers, they will need to be added
# to this route's constraints
match '/auth/:provider/callback', :to => 'auth#auth', :constraints => {:provider => /twitter/}
match '/auth/:provider/callback', :to => 'auth#invalid_auth_provider'
match '/auth/failure', :to => 'auth#failure'
match '/users/:username/auth/:provider', :via => :delete, :to => "auth#destroy", :constraints => {:username => /[^\/]+/ }
# Users
match 'users/:id.:format', :to => "users#show", :constraints => { :id => /[^\/]+/, :format => /json/ }
resources :users, :constraints => { :id => /[^\/]+/ }
match "users/:id/feed", :to => "users#feed", :as => "user_feed", :constraints => { :id => /[^\/]+/ }
# other new route?
match 'users/:id/followers', :to => "users#followers", :constraints => { :id => /[^\/]+/ }, :as => "followers"
match 'users/:id/following', :to => "users#following", :constraints => { :id => /[^\/]+/ }, :as => "following"
match 'confirm_email/:token', :to => "users#confirm_email"
match 'forgot_password', :to => "users#forgot_password_new", :via => :get, :as => "forgot_password"
match 'forgot_password', :to => "users#forgot_password_create", :via => :post
match 'forgot_password_confirm', :to => "users#forgot_password_confirm", :via => :get, :as => "forgot_password_confirm"
match 'reset_password', :to => "users#reset_password_new", :via => :get
match 'reset_password', :to => "users#reset_password_create", :via => :post
match 'reset_password/:token', :to => "users#reset_password_with_token", :via => :get, :as => "reset_password"
# Updates
resources :updates, :only => [:index, :show, :create, :destroy]
match "/timeline", :to => "updates#timeline"
match "/replies", :to => "updates#replies"
# Search
resource :search, :only => :show
# feeds
resources :feeds, :only => :show
# Webfinger
match '.well-known/host-meta', :to => "webfinger#host_meta"
match 'users/:username/xrd.xml', :to => "webfinger#xrd", :as => "user_xrd", :constraints => { :username => /[^\/]+/ }
# Salmon
match 'feeds/:id/salmon', :to => "salmon#feeds"
# Subscriptions
resources :subscriptions, :except => [:update]
match 'subscriptions/:id.atom', :to => "subscriptions#post_update", :via => :post
match 'subscriptions/:id.atom', :to => "subscriptions#show", :via => :get
end