All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.pythagoras.common.healthcheck.HealthCheckController Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
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;
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy