Skip to content

Instantly share code, notes, and snippets.

@adamw
Created October 12, 2017 12:37
Show Gist options
  • Save adamw/851bbd5aa1e1376ff969724d7f70adab to your computer and use it in GitHub Desktop.
Save adamw/851bbd5aa1e1376ff969724d7f70adab to your computer and use it in GitHub Desktop.
class MyApplicationBootstrap {
public static void main(String[] args) {
// 1. create the object graph. Manually, by using "new". Like in the stone age.
Hello h = new Hello();
// 2. create a list of all endpoints our application will expose
List<Endpoint> endpoints = new ArrayList<Endpoint>();
endpoints.addAll(new HelloEndpoints().endpoints(h));
endpoints.addAll(...);
// 3. start a web server
HttpServer.start("localhost", 8080, endpoints);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment