Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Always register the home route

// The home route is used as a probe path by Azure Load Balancer
// to determine if the node is up. So, always register the home route
// Just do so with an Empty Home, in the FeedOnlyMode, which simply returns a 200
  • Loading branch information...
commit 65adb24a605dac3f827d724aaef04f657b71561a 1 parent 3641634
@deepakaravindr deepakaravindr authored
View
11 src/NuGetGallery/App_Start/AppActivator.cs
@@ -174,6 +174,17 @@ private static void AppPostStart(IAppConfiguration configuration)
{
Routes.RegisterRoutes(RouteTable.Routes);
}
+ else
+ {
+ // The home route is used as a probe path by Azure Load Balancer
+ // to determine if the node is up. So, always register the home route
+ // Just do so with an Empty Home, in the FeedOnlyMode, which simply returns a 200
+ RouteTable.Routes.MapRoute(
+ RouteName.Home,
+ "",
+ new { controller = "Pages", action = "EmptyHome" });
+ }
+
Routes.RegisterApiV2Routes(RouteTable.Routes);
Routes.RegisterServiceRoutes(RouteTable.Routes);
AreaRegistration.RegisterAllAreas();
View
6 src/NuGetGallery/Controllers/PagesController.cs
@@ -1,5 +1,6 @@
using System;
using System.Linq;
+using System.Net;
using System.Threading.Tasks;
using System.Web.Mvc;
@@ -48,6 +49,11 @@ public virtual ActionResult Contact()
return View();
}
+ public virtual ActionResult EmptyHome()
+ {
+ return new HttpStatusCodeResult(HttpStatusCode.OK, "Empty Home");
+ }
+
public virtual async Task<ActionResult> Terms()
{
if (ContentService != null)
Please sign in to comment.
Something went wrong with that request. Please try again.