Sha256: e6d5b5624fc2be74f559c382c6cee34a4a80171df2454b6c5077652e02ff3bc3

Contents?: true

Size: 1.44 KB

Versions: 1

Compression:

Stored size: 1.44 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, :feed]
      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: [: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 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

1 entries across 1 versions & 1 rubygems

Version Path
federails-0.1.0 config/routes.rb