From 11d6186fe61b66a0c7c57760d3dc208f3d2ee07b Mon Sep 17 00:00:00 2001 From: Mars Lan Date: Fri, 31 Mar 2017 10:54:23 -0700 Subject: [PATCH] Add healthcheck endpoint for frontend & backend. (#388) --- backend-service/app/controllers/Application.java | 4 ++++ backend-service/conf/routes | 3 +++ web/app/controllers/Application.java | 5 +++++ web/conf/routes | 2 ++ 4 files changed, 14 insertions(+) diff --git a/backend-service/app/controllers/Application.java b/backend-service/app/controllers/Application.java index a9874b2692..fe91d60048 100644 --- a/backend-service/app/controllers/Application.java +++ b/backend-service/app/controllers/Application.java @@ -24,4 +24,8 @@ public class Application extends Controller { return ok("TEST"); } + public static Result healthcheck() { + return ok("GOOD"); + } + } diff --git a/backend-service/conf/routes b/backend-service/conf/routes index 04e2462fcb..7413fd56c5 100644 --- a/backend-service/conf/routes +++ b/backend-service/conf/routes @@ -5,6 +5,9 @@ # Home page GET / controllers.Application.index() +# Health check endpoint +GET /admin controllers.Application.healthcheck() + # Map static resources from the /public folder to the /assets URL path GET /assets/*file controllers.Assets.at(path="/public", file) diff --git a/web/app/controllers/Application.java b/web/app/controllers/Application.java index 02d5366eab..ac4a887970 100644 --- a/web/app/controllers/Application.java +++ b/web/app/controllers/Application.java @@ -50,6 +50,11 @@ public class Application extends Controller return ok(index.render()); } + public static Result healthcheck() + { + return ok("GOOD"); + } + @Security.Authenticated(Secured.class) public static Result index() { diff --git a/web/conf/routes b/web/conf/routes index f2d5b6fca6..bb843c0583 100644 --- a/web/conf/routes +++ b/web/conf/routes @@ -6,6 +6,8 @@ # serveAsset action requires a path string GET / controllers.Application.serveAsset(path="index.html") +GET /admin controllers.Application.healthcheck() + GET /login controllers.Application.login() GET /logout controllers.Application.logout()