in RESTProxy/App_Start/WebApiConfig.cs [25:62]
public static void Register(HttpConfiguration config)
{
// Web API routes
config.MapHttpAttributeRoutes();
// This is a really ugly, generic route. All we're trying to do is capture every
// possible REST API path that might come in, and route it to the same controller
// that only has a single method, because all we want to do is turn around and send
// the original query command (and any accompanying body) directly to the real REST
// endpoint; there's no benefit that we would gain by making separate controllers
// that truly mirror all of the possible real commands.
config.Routes.MapHttpRoute(
name: "Root", // This name is friendly and has no impact to the code.
routeTemplate: "{version}/{annotation}/{command}/{commandId}/{subCommand}/{subCommandId}/{subCommand2}/{subCommandId2}/{subCommand3}/{subCommandId3}/{subCommand4}/{subCommandId4}/{subCommand5}/{subCommandId5}/{subCommand6}/{subCommandId6}/{subCommand7}/{subCommandId7}",
defaults: new
{
controller = "root", // This tells it to route these requests to "RootController"
command = RouteParameter.Optional,
commandId = RouteParameter.Optional,
subCommand = RouteParameter.Optional,
subCommandId = RouteParameter.Optional,
subCommand2 = RouteParameter.Optional,
subCommandId2 = RouteParameter.Optional,
subCommand3 = RouteParameter.Optional,
subCommandId3 = RouteParameter.Optional,
subCommand4 = RouteParameter.Optional,
subCommandId4 = RouteParameter.Optional,
subCommand5 = RouteParameter.Optional,
subCommandId5 = RouteParameter.Optional,
subCommand6 = RouteParameter.Optional,
subCommandId6 = RouteParameter.Optional,
subCommand7 = RouteParameter.Optional,
subCommandId7 = RouteParameter.Optional,
});
WebApiConfig.ConfigureTelemetry(config);
ConfigureProxyManager();
}