19
|
1 package de.comline.config.configuration;
|
|
2
|
|
3 import org.h2.tools.Server;
|
|
4 import org.slf4j.Logger;
|
|
5 import org.slf4j.LoggerFactory;
|
|
6 import org.springframework.context.annotation.Bean;
|
|
7 import org.springframework.context.annotation.Configuration;
|
|
8
|
|
9 @Configuration
|
|
10 public class H2WebConsoleConfig {
|
|
11 private static final Logger LOG = LoggerFactory.getLogger(H2WebConsoleConfig.class);
|
|
12
|
|
13 @Bean(name = "h2WebConsole", initMethod = "start", destroyMethod = "stop")
|
|
14 public Server buildServer() throws Exception {
|
|
15 String port = "8081";
|
|
16
|
|
17 LOG.info("H2 web console server listening on port " + port);
|
|
18 return Server.createWebServer("-web", "-webAllowOthers", "-webPort", port);
|
|
19 }
|
|
20 }
|