무중단 배포용 /health 200 응답 기능 추가
This commit is contained in:
@@ -32,6 +32,8 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import java.io.IOException;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
@Controller
|
||||
public class MainController {
|
||||
@@ -88,5 +90,12 @@ public class MainController {
|
||||
}
|
||||
return startPage;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/health", method = RequestMethod.GET)
|
||||
public void health(HttpServletResponse response) throws IOException {
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
response.setContentType("text/plain;charset=UTF-8");
|
||||
response.getWriter().write("OK");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user