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.

109 lines
2.5 KiB

8 years ago
7 years ago
7 years ago
7 years ago
8 years ago
  1. require 'sidekiq/web'
  2. Rails.application.routes.draw do
  3. get 'tags/show'
  4. mount ActionCable.server => '/cable'
  5. authenticate :user, lambda { |u| u.admin? } do
  6. mount Sidekiq::Web => '/sidekiq'
  7. mount PgHero::Engine, at: 'pghero'
  8. end
  9. use_doorkeeper do
  10. controllers authorizations: 'oauth/authorizations'
  11. end
  12. get '.well-known/host-meta', to: 'xrd#host_meta', as: :host_meta
  13. get '.well-known/webfinger', to: 'xrd#webfinger', as: :webfinger
  14. devise_for :users, path: 'auth', controllers: {
  15. sessions: 'auth/sessions',
  16. registrations: 'auth/registrations',
  17. passwords: 'auth/passwords',
  18. confirmations: 'auth/confirmations'
  19. }
  20. resources :accounts, path: 'users', only: [:show], param: :username do
  21. resources :stream_entries, path: 'updates', only: [:show]
  22. member do
  23. get :followers
  24. get :following
  25. post :follow
  26. post :unfollow
  27. end
  28. end
  29. namespace :settings do
  30. resource :profile, only: [:show, :update]
  31. resource :preferences, only: [:show, :update]
  32. end
  33. resources :media, only: [:show]
  34. resources :tags, only: [:show]
  35. namespace :api do
  36. # PubSubHubbub
  37. resources :subscriptions, only: [:show]
  38. post '/subscriptions/:id', to: 'subscriptions#update'
  39. # Salmon
  40. post '/salmon/:id', to: 'salmon#update', as: :salmon
  41. # JSON / REST API
  42. namespace :v1 do
  43. resources :statuses, only: [:create, :show, :destroy] do
  44. collection do
  45. get :home
  46. get :mentions
  47. get :public
  48. get '/tag/:id', action: :tag
  49. end
  50. member do
  51. get :context
  52. get :reblogged_by
  53. get :favourited_by
  54. post :reblog
  55. post :unreblog
  56. post :favourite
  57. post :unfavourite
  58. end
  59. end
  60. resources :follows, only: [:create]
  61. resources :media, only: [:create]
  62. resources :apps, only: [:create]
  63. resources :accounts, only: [:show] do
  64. collection do
  65. get :relationships
  66. get :verify_credentials
  67. get :suggestions
  68. end
  69. member do
  70. get :statuses
  71. get :followers
  72. get :following
  73. get :common_followers
  74. post :follow
  75. post :unfollow
  76. post :block
  77. post :unblock
  78. end
  79. end
  80. end
  81. end
  82. get :about, to: 'about#index'
  83. get :terms, to: 'about#terms'
  84. root 'home#index'
  85. match '*unmatched_route', via: :all, to: 'application#raise_not_found'
  86. end