require 'sidekiq/web'

# Configure Sidekiq-specific session middleware
Sidekiq::Web.use ActionDispatch::Cookies
Sidekiq::Web.use ActionDispatch::Session::CookieStore, key: "_interslice_session"

Rails.application.routes.draw do
  mount Sidekiq::Web => '/sidekiq'
  api_version(:module => "Ayla", :header => {:name => "X-Version", :value => "Ayla"}) do
    get '/gross', to: 'jobs#get_total_all_time_gross'
    get '/get_jobs/:limit/:offset', to: 'jobs#get_jobs', as: 'get_jobs'
    post '/upload', to: 'jobs#upload'
    # O Ponto de montagem do devise_token_auth para User é auth
    mount_devise_token_auth_for 'User', at: 'auth', defaults: {format: 'json'}
  end
  match "*path" => "application#not_found", via: :all
  # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end
