require 'sidekiq/web' Sidekiq::Web.set :session_secret, Rails.application.secrets[:secret_key_base] Cas::Engine.routes.draw do mount Shrine.presign_endpoint(:cache) => "/files/cache/presign" authenticate :user, ->(u){ u.roles.include?('admin') } do mount Sidekiq::Web => '/sidekiq' end devise_for :users, class_name: "Cas::User", module: :devise, controllers: { sessions: "cas/devise/sessions" }, skip: :registrations resources :sites, only: [:index] do resources :users, controller: 'sites/users' resources :sections, only: [:index], controller: 'sites/sections' do resources :contents, controller: 'sites/sections/contents' resources :categories, controller: 'sites/sections/categories' end end # used by tinymce editor resources :file_uploads, only: :create namespace :api, module: "api" do resources :files, only: [:create, :destroy] end root 'sites/sections#index' end