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.

85 lines
1.9 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
  8. get '.well-known/host-meta', to: 'xrd#host_meta', as: :host_meta
  9. get '.well-known/webfinger', to: 'xrd#webfinger', as: :webfinger
  10. devise_for :users, path: 'auth', controllers: {
  11. sessions: 'auth/sessions',
  12. registrations: 'auth/registrations',
  13. passwords: 'auth/passwords'
  14. }
  15. resources :accounts, path: 'users', only: [:show], param: :username do
  16. resources :stream_entries, path: 'updates', only: [:show]
  17. member do
  18. get :followers
  19. get :following
  20. end
  21. end
  22. resource :settings, only: [:show, :update]
  23. resources :media, only: [:show]
  24. namespace :api do
  25. # PubSubHubbub
  26. resources :subscriptions, only: [:show]
  27. post '/subscriptions/:id', to: 'subscriptions#update'
  28. # Salmon
  29. post '/salmon/:id', to: 'salmon#update', as: :salmon
  30. # JSON / REST API
  31. namespace :v1 do
  32. resources :statuses, only: [:create, :show, :destroy] do
  33. collection do
  34. get :home
  35. get :mentions
  36. end
  37. member do
  38. get :context
  39. post :reblog
  40. post :unreblog
  41. post :favourite
  42. post :unfavourite
  43. end
  44. end
  45. resources :follows, only: [:create]
  46. resources :media, only: [:create]
  47. resources :apps, only: [:create]
  48. resources :accounts, only: [:show] do
  49. collection do
  50. get :relationships
  51. end
  52. member do
  53. get :statuses
  54. get :followers
  55. get :following
  56. post :follow
  57. post :unfollow
  58. end
  59. end
  60. end
  61. end
  62. get :about, to: 'about#index'
  63. root 'home#index'
  64. match '*unmatched_route', via: :all, to: 'application#raise_not_found'
  65. end