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.

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