Created
October 12, 2017 12:37
-
-
Save adamw/851bbd5aa1e1376ff969724d7f70adab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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