Class: ActionDispatch::Routing::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/prelaunch/routing.rb

Instance Method Summary collapse

Instance Method Details

#prelaunch_routesObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/prelaunch/routing.rb', line 3

def prelaunch_routes
  return unless Prelaunch.valid_env?

  token = Prelaunch::TokenConstraint.new

  get "#{Prelaunch.logout_path}"       , to: 'prelaunch/prelaunch#logout', as: ''
  get "#{Prelaunch.verify_path}/:token", to: 'prelaunch/prelaunch#verify', constraints: token

  contraint = Prelaunch::SessionConstraint.new

  get '*path', to: 'prelaunch/prelaunch#redirect', constraints: contraint
  get '/'    , to: 'prelaunch/prelaunch#index'   , constraints: contraint
end