Package me.nickhanson.codeforge.web
Class HealthServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
me.nickhanson.codeforge.web.HealthServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable
@WebServlet(urlPatterns="/health")
public class HealthServlet
extends jakarta.servlet.http.HttpServlet
Lightweight readiness/liveness endpoint.
Returns 200 quickly without touching downstream dependencies.
- Author:
- Nick Hanson
- See Also:
-
Field Summary
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) Handles health-check requests by returning an immediate200 OKresponse with a plain-textOKbody.Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, init, service, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
HealthServlet
public HealthServlet()
-
-
Method Details
-
doGet
protected void doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws IOException Handles health-check requests by returning an immediate200 OKresponse with a plain-textOKbody.- Overrides:
doGetin classjakarta.servlet.http.HttpServlet- Parameters:
req- the incoming HTTP requestresp- the HTTP response used to return health status- Throws:
IOException- if writing the response fails
-