Skip to content

Commit e298d7e

Browse files
committed
add HealthController with health check endpoint
1 parent 208c39a commit e298d7e

File tree

6 files changed

+15
-0
lines changed

6 files changed

+15
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.example.controller;
2+
3+
import org.springframework.web.bind.annotation.GetMapping;
4+
import org.springframework.web.bind.annotation.RestController;
5+
import java.util.Map;
6+
7+
@RestController
8+
public class HealthController {
9+
@GetMapping("/health")
10+
public Map<String, String> health() {
11+
return Map.of("status", "UP");
12+
}
13+
}
792 Bytes
Binary file not shown.

target/java-api-0.0.1-SNAPSHOT.jar

655 Bytes
Binary file not shown.
605 Bytes
Binary file not shown.

target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
com/example/model/User.class
22
com/example/exception/UserNotFoundException.class
3+
com/example/controller/HealthController.class
34
com/example/repository/UserRepository.class
45
com/example/controller/UserController.class
56
com/example/RestApiApplication.class

target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
/home/gaellopes/java-api-with-otlp-sdk/src/main/java/com/example/RestApiApplication.java
55
/home/gaellopes/java-api-with-otlp-sdk/src/main/java/com/example/repository/UserRepository.java
66
/home/gaellopes/java-api-with-otlp-sdk/src/main/java/com/example/controller/UserController.java
7+
/home/gaellopes/java-api-with-otlp-sdk/src/main/java/com/example/controller/HealthController.java
78
/home/gaellopes/java-api-with-otlp-sdk/src/main/java/com/example/model/User.java

0 commit comments

Comments
 (0)