闭社主体 forked from https://github.com/tootsuite/mastodon
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.

62 lines
1.3 KiB

8 years ago
8 years ago
  1. Rails.application.routes.draw do
  2. use_doorkeeper do
  3. controllers applications: 'oauth/applications'
  4. end
  5. get '.well-known/host-meta', to: 'xrd#host_meta', as: :host_meta
  6. get '.well-known/webfinger', to: 'xrd#webfinger', as: :webfinger
  7. devise_for :users, path: 'auth', controllers: {
  8. sessions: 'auth/sessions',
  9. registrations: 'auth/registrations',
  10. passwords: 'auth/passwords'
  11. }
  12. resources :accounts, path: 'users', only: [:show], param: :username do
  13. resources :stream_entries, path: 'updates', only: [:show]
  14. member do
  15. get :followers
  16. get :following
  17. end
  18. end
  19. resource :settings, only: [:show, :update]
  20. namespace :api do
  21. # PubSubHubbub
  22. resources :subscriptions, only: [:show]
  23. post '/subscriptions/:id', to: 'subscriptions#update'
  24. # Salmon
  25. post '/salmon/:id', to: 'salmon#update', as: :salmon
  26. # JSON / REST API
  27. resources :statuses, only: [:create, :show] do
  28. collection do
  29. get :home
  30. get :mentions
  31. end
  32. member do
  33. post :reblog
  34. post :favourite
  35. end
  36. end
  37. resources :follows, only: [:create]
  38. resources :accounts, only: [:show] do
  39. member do
  40. get :statuses
  41. get :followers
  42. get :following
  43. post :follow
  44. post :unfollow
  45. end
  46. end
  47. end
  48. root 'home#index'
  49. end