Skip to content

Latest commit

 

History

History
20 lines (17 loc) · 958 Bytes

app-init-environment.md

File metadata and controls

20 lines (17 loc) · 958 Bytes

AppInit & Environment

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().