Skip to content

Commit

Permalink
Use no-arg constructor for HttpService
Browse files Browse the repository at this point in the history
  • Loading branch information
barchetta committed Sep 22, 2023
1 parent 2e6baf3 commit 13d68e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public class GreetService implements HttpService {
*/
private final AtomicReference<String> greeting = new AtomicReference<>();

GreetService(Config config) {
GreetService() {
Config config = Config.global();
greeting.set(config.get("app.greeting").asString().orElse("Ciao"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ static void setup(WebServerConfig.Builder server) {
* @param routing routing builder
*/
private static void routing(HttpRouting.Builder routing) {
Config config = Config.global();
routing.addFeature(ObserveFeature.create())
.register("/greet", new GreetService(config));
.register("/greet", new GreetService());
}
}

0 comments on commit 13d68e6

Please sign in to comment.