-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathportal.rb
More file actions
24 lines (21 loc) · 646 Bytes
/
portal.rb
File metadata and controls
24 lines (21 loc) · 646 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'sinatra/base'
require 'newrelic_rpm'
class Portal < Sinatra::Base
set :root, File.dirname(__FILE__)
set :views, settings.root + '/portal'
set :logging, true
get /asset\/*(.*)/ do |asset|
send_file "#{settings.root}/portal/#{asset}"
end
get '/*' do
logger.info "User-Agent: #{request.user_agent}"
@asset_path = "/portal/asset/"
@serviceID = ENV['SERVICE_ID']
@baseUrl = request.url.gsub(request.path, '')
@authServiceUri = ENV['AUTH_SERVICE_BASE_URI']
@authServiceName = ENV['AUTH_SERVICE_NAME']
@securityState = SecureRandom.hex
@environment = ENV['RAILS_ENV']
erb :index
end
end