health endpoint
All checks were successful
Build and Deploy / Build & Push Image (push) Successful in 31s
All checks were successful
Build and Deploy / Build & Push Image (push) Successful in 31s
This commit is contained in:
17
lib/cobblemon_ui_web/health_check.ex
Normal file
17
lib/cobblemon_ui_web/health_check.ex
Normal file
@@ -0,0 +1,17 @@
|
||||
defmodule CobblemonUiWeb.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
|
||||
Reference in New Issue
Block a user