From d69e8135f4ce13350ecefac51a09efdd6602c690 Mon Sep 17 00:00:00 2001 From: Cameron Alexander Date: Mon, 14 Nov 2016 15:38:49 -0600 Subject: [PATCH] Add marathon health check for /heimdall-health-check --- lib/router.ex | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/router.ex b/lib/router.ex index febee33..5c87c0d 100644 --- a/lib/router.ex +++ b/lib/router.ex @@ -1,6 +1,6 @@ defmodule Heimdall.Router do @moduledoc """ - The applications router plug. + The applications router plug. Forwards Marathon callback events coming in from /marathon-callback to `Heimdall.Marathon.BingeWatch` which will update the dynamic routes. @@ -11,6 +11,7 @@ defmodule Heimdall.Router do use Plug.Router alias Heimdall.Marathon.BingeWatch alias Heimdall.DynamicRoutes + import Rackla plug :match plug :dispatch @@ -18,6 +19,12 @@ defmodule Heimdall.Router do forward "/marathon-callback", to: BingeWatch + get "/heimdall-health-check" do + Application.fetch_env!(:heimdall, :marathon_url) <> "/ping" + |> request + |> response + end + forward "/", to: DynamicRoutes, tab: :heimdall_routes end