asxpio/config.ru
Sergei Poljanski 90e1bbc9c5
All checks were successful
Build and Deploy to Production / test (push) Successful in 21s
Build and Deploy to Production / build (push) Successful in 52s
Build and Deploy to Production / deploy (push) Successful in 39s
bingo: move to datacenterbingo.xyz
The card gets its own domain instead of a subdomain of the IE site.
www. is routed to the same container and 301-redirected to the apex in
config.ru, so there is one canonical host for links and the cert.

Assisted-by: Claude:opus-5
2026-10-10 05:19:50 +04:00

17 lines
492 B
Ruby

require 'sinatra/base'
require './asxpio.rb'
require './bingo_web.rb'
# One process, two sites: BINGO_HOST gets the bingo, everything else asxp.io.
asxpio = AsxpioWeb.new
bingo = BingoWeb.new
bingo_host = ENV['BINGO_HOST']
run lambda { |env|
req = Rack::Request.new(env)
if bingo_host && req.host == "www.#{bingo_host}"
[301, { 'location' => "https://#{bingo_host}#{req.fullpath}" }, []]
else
(bingo_host && req.host == bingo_host ? bingo : asxpio).call(env)
end
}