Skip to content

Commit f36836f

Browse files
add sidekiq web ui and redirect from root to admin
1 parent 887d38f commit f36836f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

config/routes.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'sidekiq/web'
2+
13
Rails.application.routes.draw do
24
Spree::Core::Engine.add_routes do
35
# Admin authentication
@@ -25,7 +27,14 @@
2527
devise_for :admin_users, class_name: "Spree::AdminUser"
2628
devise_for :users, class_name: "Spree::User"
2729

30+
# Sidekiq Web UI
31+
authenticate Spree.admin_user_class.model_name.singular_route_key.to_sym, ->(admin_user) { admin_user.spree_admin? } do
32+
mount Sidekiq::Web => "/sidekiq" # access it at http://localhost:3000/sidekiq
33+
end
34+
2835
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
2936
# Can be used by load balancers and uptime monitors to verify that the app is live.
3037
get "up" => "rails/health#show", as: :rails_health_check
38+
39+
root to: redirect('/admin')
3140
end

0 commit comments

Comments
 (0)