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.

93 lines
2.1 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. confirmations: 'auth/confirmations'
  15. }
  16. resources :accounts, path: 'users', only: [:show], param: :username do
  17. resources :stream_entries, path: 'updates', only: [:show]
  18. member do
  19. get :followers
  20. get :following
  21. post :follow
  22. post :unfollow
  23. end
  24. end
  25. resource :settings, only: [:show, :update]
  26. resources :media, only: [:show]
  27. namespace :api do
  28. # PubSubHubbub
  29. resources :subscriptions, only: [:show]
  30. post '/subscriptions/:id', to: 'subscriptions#update'
  31. # Salmon
  32. post '/salmon/:id', to: 'salmon#update', as: :salmon
  33. # JSON / REST API
  34. namespace :v1 do
  35. resources :statuses, only: [:create, :show, :destroy] do
  36. collection do
  37. get :home
  38. get :mentions
  39. get :public
  40. end
  41. member do
  42. get :context
  43. post :reblog
  44. post :unreblog
  45. post :favourite
  46. post :unfavourite
  47. end
  48. end
  49. resources :follows, only: [:create]
  50. resources :media, only: [:create]
  51. resources :apps, only: [:create]
  52. resources :accounts, only: [:show] do
  53. collection do
  54. get :relationships
  55. get :verify_credentials
  56. end
  57. member do
  58. get :statuses
  59. get :followers
  60. get :following
  61. post :follow
  62. post :unfollow
  63. post :block
  64. post :unblock
  65. end
  66. end
  67. end
  68. end
  69. get :about, to: 'about#index'
  70. root 'home#index'
  71. match '*unmatched_route', via: :all, to: 'application#raise_not_found'
  72. end