class Falcon::Command::Redirect

def call

Prepare the environment and run the controller.
def call
	Console.logger.info(self) do |buffer|
		buffer.puts "Falcon Redirect v#{VERSION} taking flight!"
		buffer.puts "- Binding to: #{@options[:bind]}"
		buffer.puts "- To terminate: Ctrl-C or kill #{Process.pid}"
		buffer.puts "- To reload: kill -HUP #{Process.pid}"
		
		self.resolved_paths.each do |path|
			buffer.puts "- Loading configuration from #{path}"
		end
	end
	
	Async::Service::Controller.run(self.configuration)
end

def configuration

def configuration
	Configuration.for(
		self.environment(environments: super.environments)
	)
end

def endpoint(**options)

The endpoint to bind to.
def endpoint(**options)
	Async::HTTP::Endpoint.parse(@options[:bind], timeout: @options[:timeout], **options)
end

def environment(**options)

def environment(**options)
	Async::Service::Environment.new(Falcon::Environment::Redirect).with(
		root: Dir.pwd,
		name: self.class.name,
		verbose: self.parent&.verbose?,
		url: @options[:bind],
		redirect_url: @options[:redirect],
		timeout: @options[:timeout],
		**options
	)
end

def redirect_endpoint(**options)

The template endpoint to redirect to.
def redirect_endpoint(**options)
	Async::HTTP::Endpoint.parse(@options[:redirect], **options)
end