From cd83c94eb80559a96ea9d35d156fac89f45a27d5 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Fri, 12 Apr 2024 16:53:38 -0400 Subject: [PATCH] Add healthcheck route --- lib/tusker_push_web/controllers/healthcheck_controller.ex | 7 +++++++ lib/tusker_push_web/router.ex | 4 ++++ 2 files changed, 11 insertions(+) create mode 100644 lib/tusker_push_web/controllers/healthcheck_controller.ex diff --git a/lib/tusker_push_web/controllers/healthcheck_controller.ex b/lib/tusker_push_web/controllers/healthcheck_controller.ex new file mode 100644 index 0000000..81ed14e --- /dev/null +++ b/lib/tusker_push_web/controllers/healthcheck_controller.ex @@ -0,0 +1,7 @@ +defmodule TuskerPushWeb.HealthcheckController do + use TuskerPushWeb, :controller + + def healthcheck(conn, _params) do + send_resp(conn, 200, "ok") + end +end diff --git a/lib/tusker_push_web/router.ex b/lib/tusker_push_web/router.ex index 0a5978b..c6c2bf5 100644 --- a/lib/tusker_push_web/router.ex +++ b/lib/tusker_push_web/router.ex @@ -5,6 +5,10 @@ defmodule TuskerPushWeb.Router do plug :accepts, ["json"] end + scope "/", TuskerPushWeb do + get "/healthcheck", HealthcheckController, :healthcheck + end + scope "/push", TuskerPushWeb do pipe_through :api