2020-02-07

Spring - Using H2’s Web Console

The H2 database provides a browser-based console that Spring Boot can auto-configure for you. The
console is auto-configured when the following conditions are met:
• You are developing a servlet-based web application.
• com.h2database:h2 is on the classpath.
• You are using Spring Boot’s developer tools.

If you are not using Spring Boot’s developer tools but would still like to make use
of H2’s console, you can configure the configprop:spring.h2.console.enabled[]
property with a value of true.

The H2 console is only intended for use during development, so you should take
care to ensure that spring.h2.console.enabled is not set to true in production.

Changing the H2 Console’s Path

By default, the console is available at /h2-console. You can customize the console’s path by using the
configprop:spring.h2.console.path[] property.

No comments:

Post a Comment