Apollo applications are initialized through the
AppInit interface either by
implementing it directly or through a method reference. This allows you to have different
initialization methods for running the service and testing it.
public interface AppInit {
void create(Environment environment);
}A typical application will read values from
Environment.config() and set
up any application specific resources. To be properly closed when shutting down, these resources
should be registered with
Environment.closer(). In
addition to the resources the application should register one or more endpoints (routes) using
Environment.routingEngine().