Sha256: 43267eb466f0f8a28ba28b2fa96f52ae6131e8a9b3c693d79fe07d0104e27e8b

Contents?: true

Size: 1.56 KB

Versions: 2

Compression:

Stored size: 1.56 KB

Contents

Federails::Engine.routes.draw do
  if Federails.configuration.enable_discovery
    scope path: '/' do
      get '/.well-known/webfinger', to: 'server/web_finger#find', as: :webfinger
      get '/.well-known/host-meta', to: 'server/web_finger#host_meta', as: :host_meta
      get '/.well-known/nodeinfo', to: 'server/nodeinfo#index', as: :node_info
      get '/nodeinfo/2.0', to: 'server/nodeinfo#show', as: :show_node_info
    end
  end

  if Federails.configuration.client_routes_path
    scope Federails.configuration.client_routes_path, module: :client, as: :client do
      resources :activities, only: [:index] do
        collection do
          get :feed, to: 'activities#feed'
        end
      end
      resources :actors, only: [:index, :show] do
        collection do
          get :lookup, to: 'actors#lookup'
        end
        resources :activities, only: [:index]
      end
      get :feed, to: 'activities#feed'
      resources :followings, only: [:new, :create, :destroy] do
        collection do
          post :follow, to: 'followings#follow'
        end

        member do
          put :accept, to: 'followings#accept'
        end
      end
    end
  end

  scope Federails.configuration.server_routes_path, module: :server, as: :server, defaults: { format: :activitypub } do
    resources :actors, only: [:show] do
      member do
        get :followers
        get :following
      end
      get :outbox, to: 'activities#outbox'
      post :inbox, to: 'activities#create'
      resources :activities, only: [:show]
      resources :followings, only: [:show]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
federails-0.4.0 config/routes.rb
federails-0.3.0 config/routes.rb