Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I enable h2 console in application.yml for SpringBoot?

Tags:

spring-boot

h2

I have an application.yml file where I want to enable h2-console but on searching over google I got results only for application.properties file. Can anyone help?

like image 650
0coder Avatar asked Dec 18 '22 20:12

0coder


2 Answers

You can use below configuration.

spring:
  h2:
    console:
      enabled: true
      path: /h2-console

Refer this for more : https://github.com/khoubyari/spring-boot-rest-example/blob/master/src/main/resources/application.yml

AND

https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-sql-h2-console

like image 102
Alien Avatar answered Dec 20 '22 10:12

Alien


you need to use this structure

###
#   H2 Settings
###
  h2:
    console:
      enabled: true
      path: /console
      settings:
        trace: false
        web-allow-others: false
like image 33
Alexander Petrov Avatar answered Dec 20 '22 09:12

Alexander Petrov