You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
1.7 KiB

8 years ago
8 years ago
  1. require 'sidekiq/web'
  2. Rails.application.routes.draw do
  3. mount ActionCable.server => '/cable'
  4. authenticate :user, lambda { |u| u.admin? } do
  5. mount Sidekiq::Web => '/sidekiq'
  6. end
  7. use_doorkeeper do
  8. controllers applications: 'oauth/applications'
  9. end
  10. get '.well-known/host-meta', to: 'xrd#host_meta', as: :host_meta
  11. get '.well-known/webfinger', to: 'xrd#webfinger', as: :webfinger
  12. devise_for :users, path: 'auth', controllers: {
  13. sessions: 'auth/sessions',
  14. registrations: 'auth/registrations',
  15. passwords: 'auth/passwords'
  16. }
  17. resources :accounts, path: 'users', only: [:show], param: :username do
  18. resources :stream_entries, path: 'updates', only: [:show]
  19. member do
  20. get :followers
  21. get :following
  22. end
  23. end
  24. resource :settings, only: [:show, :update]
  25. resources :media, only: [:show]
  26. namespace :api do
  27. # PubSubHubbub
  28. resources :subscriptions, only: [:show]
  29. post '/subscriptions/:id', to: 'subscriptions#update'
  30. # Salmon
  31. post '/salmon/:id', to: 'salmon#update', as: :salmon
  32. # JSON / REST API
  33. resources :statuses, only: [:create, :show] do
  34. collection do
  35. get :home
  36. get :mentions
  37. end
  38. member do
  39. get :context
  40. post :reblog
  41. post :favourite
  42. end
  43. end
  44. resources :follows, only: [:create]
  45. resources :media, only: [:create]
  46. resources :accounts, only: [:show] do
  47. member do
  48. get :statuses
  49. get :followers
  50. get :following
  51. post :follow
  52. post :unfollow
  53. end
  54. end
  55. end
  56. root 'home#index'
  57. match '*unmatched_route', via: :all, to: 'application#raise_not_found'
  58. end