-
Notifications
You must be signed in to change notification settings - Fork 1
/
routes.rb
175 lines (148 loc) · 4.92 KB
/
routes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# frozen_string_literal: true
require 'sidekiq/web'
require 'sidekiq-scheduler/web'
Rails.application.routes.draw do
mount API::Root => '/'
# mount ImageUploader.upload_endpoint(:cache) => '/images/upload'
mount ImageUploader.derivation_endpoint => 'derivations/image'
# get '/derivations/image/*rest' => 'derivations#image'
# mount Yabeda::Prometheus::Exporter => "/metrics"
# scope constraints: RoastmeConstraint.new do
scope '(:locale)', constraints: LocalesConstraint.new do
# scope module: 'tables' do
# resources :mentions, only: %i[index]
# # resources :entities, only: [:index]
# end
resources :mentions, only: %i[index show]
resources :listings, only: [:show]
resources :entities, only: %i[show] do
# member do
# get :popover
# end
end
get 'tinder' => 'roastme/tinder#index'
root to: 'mentions#index', as: :roastme_root
end
# end
scope constraints: WebsiteConstraint.new do
# root to: 'tables/articles#index', as: :articles
get '/robots.txt', to: 'robots#index'
# scope controller: 'tables/articles', as: :articles do
# get 'month/:month', action: :by_month, as: :by_month
# get 'tag/:tag', action: :by_tag, as: :by_tag, constraints: { tag: %r{[^/]*} }
# get 'category/:category_id', action: :by_category, as: :by_category
# end
# namespace :frames do
# namespace :articles do
# get 'month(/:month)', to: 'month#index', as: :month
# get 'tag(/:tag)', to: 'tag#index', as: :tag, constraints: { tag: %r{[^/]*} }
# get 'category(/:category_id)', to: 'category#index', as: :category
# end
# end
# resources :articles, only: :show
end
get '/robots.txt', to: 'robots#index'
# TODO: to test
get "/#{ENV.fetch('INDEX_NOW_KEY')}", to: 'index_now#index', as: :index_now
authenticate :user, ->(u) { u.admin? } do
mount Sidekiq::Web => '/sidekiq'
end
devise_scope :user do
Rails.configuration.oauth_providers.each do |provider|
get "/users/auth/#{provider}/callback" => 'users/omniauth_callbacks#callback', defaults: { provider: }
end
end
scope '(:locale)', constraints: LocalesConstraint.new do
devise_for :users,
path: 'auth',
path_names: {
sign_in: 'login',
sign_out: 'logout',
password: 'password',
confirmation: 'verification',
unlock: 'unblock',
registration: 'register',
sign_up: 'new'
},
controllers: {
sessions: 'users/sessions',
registrations: 'users/registrations',
confirmations: 'users/confirmations',
passwords: 'users/passwords',
unlocks: 'users/unlocks'
}
scope module: 'tables' do
resources :accounts, only: [:index]
resources :checks, only: [:index]
resources :advertisers, only: [:index] do
resources :offers, only: [:index]
end
resources :feeds, only: [:index] do
resources :offers, only: [:index]
end
resources :post_categories, only: [:index]
resources :realms, only: [:index]
resources :feed_categories, only: [:index] do
resources :offers, only: [:index]
end
resources :offers, only: [:index]
resources :posts, only: [:index]
resources :transactions, only: [:index]
resources :users, only: [:index]
end
namespace :frames do
namespace :articles do
get 'latest', to: 'latest#index', as: :latest
end
end
namespace :widgets do
resources :simples
end
resources :widgets
resources :accounts
resources :advertisers
resources :checks
resources :post_categories do
end
namespace :post_categories do
resource :import, only: %i[create new]
end
resources :realms
resources :posts
resources :users do
post :impersonate, on: :member
post :stop_impersonating, on: :collection
get :auth_complete, on: :collection
end
# sign_out_via: [*::Devise.sign_out_via, ActiveAdmin.application.logout_link_method].uniq
resources :feeds do
member do
get :logs
# NOTE: not tested
get :shrinked
patch :prioritize
end
end
resources :offers, only: [:index] do
member do
get :modal_card
end
end
# resources :promotions
namespace :table do
resources :columns
resources :workspaces
resource :filters, only: %i[create update], path_names: { create: '' }
end
get 'settings(/*tab)', to: 'settings#show'
namespace :ajax do
namespace :post_categories do
resources :empties, only: %i[index]
end
resources :users, controller: 'users', only: %i[index]
end
get 'api_docs', to: 'api_docs#index'
root to: 'mentions#index'
get '*page', to: 'pages#show'
end
end