Files
redux-scraper/config/routes.rb
2024-12-19 06:04:37 +00:00

76 lines
2.1 KiB
Ruby

Rails.application.routes.draw do
root to: "pages#root"
mount ActionCable.server => "/cable"
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
namespace :api do
namespace :fa do
get :similar_users, to: "/domain/fa/api#similar_users"
get :search_user_names, to: "/domain/fa/api#search_user_names"
end
end
namespace :domain do
namespace :fa do
resources :users, param: :url_name, only: [:show]
resources :posts, param: :fa_id, only: [:show]
end
end
resources :blobs, only: [], slug: :sha256 do
get :contents, on: :member
end
get "us/:script", to: "user_scripts#get", constraints: { script: /.*/ }
scope constraints: VpnOnlyRouteConstraint.new do
mount PgHero::Engine => "pghero"
mount GoodJob::Engine => "jobs"
namespace :api do
get "search/user/:prefix", to: "search#user"
namespace :fa do
post :enqueue_objects, to: "/domain/fa/api#enqueue_objects"
post :object_statuses, to: "/domain/fa/api#object_statuses"
get :export_user, to: "/domain/fa/export#user"
end
namespace :twitter do
post :enqueue_objects, to: "/domain/twitter/api#enqueue_objects"
post :object_statuses, to: "/domain/twitter/api#object_statuses"
end
end
namespace :domain do
namespace :fa do
resources :users, param: :url_name, only: [] do
resources :posts, controller: "/domain/fa/posts"
end
resources :posts, param: :fa_id, only: [:index] do
post :scan_post, on: :member
end
end
namespace :inkbunny, path: "ib" do
resources :posts,
only: %i[show index],
controller: "/domain/inkbunny/posts"
resources :users, param: :name, only: [:show]
end
end
resources :blobs, only: [:show], slug: :sha256
resources :log_entries, only: %i[index show] do
get :stats, on: :collection
get "filter/*filter",
on: :collection,
action: :index,
constraints: {
filter: /.*/
}
end
end
end