# HG changeset patch # User Dirk Olmes # Date 1597328900 -7200 # Node ID 0c3494137a82fd03b226c97cb361c3e5ec733027 # Parent d57d0c6a841b74690883ff612a137c2312df8a12 Starte eine H2 web console auf port 8081 fuer besseres DB debugging. diff -r d57d0c6a841b -r 0c3494137a82 spring-boot-playground/src/main/java/de/comline/spring/application/AutoConfiguredApplication.java --- a/spring-boot-playground/src/main/java/de/comline/spring/application/AutoConfiguredApplication.java Thu Aug 13 16:18:20 2020 +0200 +++ b/spring-boot-playground/src/main/java/de/comline/spring/application/AutoConfiguredApplication.java Thu Aug 13 16:28:20 2020 +0200 @@ -12,6 +12,7 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories; @ComponentScan(basePackages = { + "de.comline.spring.config", "de.comline.spring.controller", "de.comline.spring.service" }) diff -r d57d0c6a841b -r 0c3494137a82 spring-boot-playground/src/main/java/de/comline/spring/config/H2WebConsoleConfig.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spring-boot-playground/src/main/java/de/comline/spring/config/H2WebConsoleConfig.java Thu Aug 13 16:28:20 2020 +0200 @@ -0,0 +1,20 @@ +package de.comline.spring.config; + +import org.h2.tools.Server; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class H2WebConsoleConfig { + private static final Logger LOG = LoggerFactory.getLogger(H2WebConsoleConfig.class); + + @Bean(initMethod = "start", destroyMethod = "stop") + public Server buildServer() throws Exception { + String port = "8081"; + + LOG.info("H2 web console server listening on port " + port); + return Server.createWebServer("-web", "-webAllowOthers", "-webPort", port); + } +}