view spring-cloud-config-server/src/main/java/de/comline/config/configuration/H2WebConsoleConfig.java @ 19:fe6a57f7a2cf

Spring Cloud Config server
author Dirk Olmes <dirk.olmes@codedo.de>
date Thu, 17 Sep 2020 17:24:48 +0200
parents
children
line wrap: on
line source

package de.comline.config.configuration;

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(name = "h2WebConsole", 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);
	}
}