module Falcon::Environment::Redirect

def environments

@returns [Array(Async::Service::Environment)]
The services we will redirect to.
def environments
	[]
end

def hosts

def hosts
	hosts = {}
	
	environments.each do |environment|
		evaluator = environment.evaluator
		
		if environment.implements?(Falcon::Environment::Application)
			Console.info(self) {"Redirecting #{self.url} to #{evaluator.authority}"}
			hosts[evaluator.authority] = evaluator
		end
	end
	
	return hosts
end

def middleware

Load the {Middleware::Redirect} application with the specified hosts.
def middleware
	Middleware::Redirect.new(Middleware::NotFound, hosts, redirect_endpoint)
end

def redirect_endpoint

def redirect_endpoint
	Async::HTTP::Endpoint.parse(redirect_url)
end

def redirect_url

def redirect_url
	"https://[::]:443"
end