The code powering m.abunchtell.com https://m.abunchtell.com
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.
 
 
 
 

77 lines
1.7 KiB

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