Skip to content

Commit d9a8b4e

Browse files
committed
add health endpoint
1 parent 736cedf commit d9a8b4e

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dependencies {
2323
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
2424
implementation 'org.springframework.boot:spring-boot-starter-web'
2525
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'
26+
implementation 'org.springframework.boot:spring-boot-starter-actuator'
2627
implementation 'org.jetbrains.kotlin:kotlin-reflect'
2728
runtimeOnly 'org.postgresql:postgresql'
2829
testImplementation 'org.springframework.boot:spring-boot-starter-test'

src/main/kotlin/com/ss/demo/SpringKotlinPostgresDemoApplication.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class SpringKotlinPostgresDemoApplication {
1313
@Bean
1414
fun initializeDatabase(wordRepository: WordRepository): CommandLineRunner {
1515
return CommandLineRunner {
16-
wordRepository.save(WordEntity(word = "serverless salad infra pal world"))
16+
wordRepository.save(WordEntity(word = "Serverless Salad Infrapal World"))
1717
}
1818
}
1919
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
spring.datasource.url=${DB_URL}
22
spring.datasource.username=${DB_USERNAME}
33
spring.datasource.password=${DB_PASSWORD}
4-
spring.jpa.hibernate.ddl-auto=update
4+
spring.jpa.hibernate.ddl-auto=update
5+
management.endpoints.web.base-path=/
6+
management.endpoints.web.exposure.include=health

0 commit comments

Comments
 (0)