io.pythagoras.common.healthcheck.HealthCheckController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of health-check Show documentation
Show all versions of health-check Show documentation
Pythagoras Common Libs - Health Check
package io.pythagoras.common.healthcheck;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/util")
public class HealthCheckController {
@Value(value = "${spring.application.name}")
private String APP_NAME;
@RequestMapping(value="/health", method = RequestMethod.GET)
public ResponseEntity> healthCheck() {
return ResponseEntity.status(HttpStatus.OK).body("OK");
}
@RequestMapping(value = "/who", method = RequestMethod.GET)
public String name() {
return APP_NAME;
}
}