Files
elixirAI/lib/elixir_ai_web/plugs/health_check.ex
Alex Mickelson 876602fb4a
All checks were successful
CI/CD Pipeline / build (push) Successful in 31s
healthcheck improvements
2026-03-09 15:38:49 -06:00

18 lines
441 B
Elixir

defmodule ElixirAiWeb.Plugs.HealthCheck do
@moduledoc """
A lightweight health check plug that responds before hitting the router.
This avoids unnecessary processing and logging for health check requests.
"""
import Plug.Conn
def init(opts), do: opts
def call(%Plug.Conn{request_path: "/health"} = conn, _opts) do
conn
|> send_resp(200, ~s({"status":"ok"}))
|> halt()
end
def call(conn, _opts), do: conn
end