Files
astuto/config/routes.rb

96 lines
3.1 KiB
Ruby
Raw Normal View History

2019-08-18 14:51:37 +02:00
Rails.application.routes.draw do
2022-07-18 10:47:54 +02:00
if Rails.application.multi_tenancy?
constraints subdomain: 'showcase' do
root to: 'static_pages#showcase', as: :showcase
end
2022-07-18 10:47:54 +02:00
constraints subdomain: 'login' do
get '/signup', to: 'tenants#new'
2022-07-22 16:50:36 +02:00
get '/is_available', to: 'tenants#is_available'
2022-07-18 10:47:54 +02:00
resource :tenants, only: [:create]
end
2024-05-03 18:11:07 +02:00
constraints subdomain: 'billing' do
get '/billing', to: 'billing#index'
get '/billing/return', to: 'billing#return'
post '/create_checkout_session', to: 'billing#create_checkout_session'
get '/session_status', to: 'billing#session_status'
post '/webhook', to: 'billing#webhook'
end
2022-05-01 18:00:38 +02:00
end
2022-07-18 10:47:54 +02:00
constraints subdomain: /.*/ do
root to: 'static_pages#root'
2022-07-18 10:47:54 +02:00
get '/roadmap', to: 'static_pages#roadmap'
get '/embedded_roadmap', to: 'static_pages#embedded_roadmap'
2022-07-18 10:47:54 +02:00
get '/pending-tenant', to: 'static_pages#pending_tenant'
get '/blocked-tenant', to: 'static_pages#blocked_tenant'
2024-05-03 18:11:07 +02:00
get '/request_billing_page', to: 'billing#request_billing_page'
2022-07-18 10:47:54 +02:00
devise_for :users, :controllers => {
:registrations => 'registrations',
:sessions => 'sessions',
:passwords => 'passwords'
2022-07-18 10:47:54 +02:00
}
devise_scope :user do
get '/users/send_set_password_instructions', to: 'registrations#send_set_password_instructions', as: :send_set_password_instructions
end
2022-07-18 10:47:54 +02:00
resources :tenants, only: [:show, :update]
resources :users, only: [:index, :update]
resources :o_auths, only: [:index, :create, :update, :destroy] do
resource :tenant_default_o_auths, only: [:create, :destroy]
end
get '/o_auths/:id/start', to: 'o_auths#start', as: :o_auth_start
get '/o_auths/:id/callback', to: 'o_auths#callback', as: :o_auth_callback
2024-01-22 14:45:48 +01:00
get '/o_auths/sign_in_from_oauth_token', to: 'o_auths#sign_in_from_oauth_token', as: :o_auth_sign_in_from_oauth_token
2022-07-18 10:47:54 +02:00
resources :posts, only: [:index, :create, :show, :update, :destroy] do
resource :follows, only: [:create, :destroy]
resources :follows, only: [:index]
resource :likes, only: [:create, :destroy]
resources :likes, only: [:index]
resources :comments, only: [:index, :create, :update, :destroy]
resources :post_status_changes, only: [:index]
2024-07-12 20:38:46 +02:00
get '/moderation', on: :collection, to: 'posts#moderation'
2022-07-18 10:47:54 +02:00
end
resources :boards, only: [:index, :create, :update, :destroy, :show] do
patch 'update_order', on: :collection
end
resources :post_statuses, only: [:index, :create, :update, :destroy] do
patch 'update_order', on: :collection
end
2024-09-06 20:27:15 +02:00
resources :invitations, only: [:create]
post '/invitations/test', to: 'invitations#test', as: :invitation_test
2022-07-18 10:47:54 +02:00
namespace :site_settings do
get 'general'
2024-01-23 18:50:42 +01:00
get 'authentication'
2022-07-18 10:47:54 +02:00
get 'boards'
get 'post_statuses'
get 'roadmap'
2024-09-06 20:27:15 +02:00
get 'invitations'
2024-01-23 18:50:42 +01:00
get 'appearance'
2024-07-12 20:38:46 +02:00
end
namespace :moderation do
get 'feedback'
2022-07-18 10:47:54 +02:00
get 'users'
end
2022-05-01 18:00:38 +02:00
end
# Healthcheck endpoint
get '/health', to: proc {
Tenant.first # to make sure db works
[200, {}, ['success']]
}
2019-08-18 14:51:37 +02:00
end