view spring-boot-playground/src/main/java/de/comline/spring/config/H2WebConsoleConfig.java @ 13:a633d0623278

Die Sequenz startet bei 1 und wird auch nur um 1 erhoeht
author Dirk Olmes <dirk.olmes@codedo.de>
date Fri, 14 Aug 2020 08:13:57 +0200
parents 0c3494137a82
children
line wrap: on
line source

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);
	}
}