diff --git a/templates/Mustache/2.x/Steeltoe-WebApi/Controllers/ValuesController.cs b/templates/Mustache/2.x/Steeltoe-WebApi/Controllers/ValuesController.cs index d60465d..6dce65c 100644 --- a/templates/Mustache/2.x/Steeltoe-WebApi/Controllers/ValuesController.cs +++ b/templates/Mustache/2.x/Steeltoe-WebApi/Controllers/ValuesController.cs @@ -47,7 +47,7 @@ namespace {{ProjectNameSpace}}.Controllers [Route("api/[controller]")] [ApiController] public class ValuesController : ControllerBase -{ + { {{^MoreThanOneValuesControllerWithArgs}} {{#SQLServer}} private readonly SqlConnection _dbConnection; diff --git a/templates/Mustache/2.x/Steeltoe-WebApi/Startup.cs b/templates/Mustache/2.x/Steeltoe-WebApi/Startup.cs index a16962d..47f3ce3 100644 --- a/templates/Mustache/2.x/Steeltoe-WebApi/Startup.cs +++ b/templates/Mustache/2.x/Steeltoe-WebApi/Startup.cs @@ -91,10 +91,10 @@ namespace {{ProjectNameSpace}} {{#Actuators}} {{#CloudFoundry}} services.ConfigureCloudFoundryOptions(Configuration); - services.AddCloudFoundryActuators(Configuration, MediaTypeVersion.V2, ActuatorContext.ActuatorAndCloudFoundry); + services.AddCloudFoundryActuators(Configuration, MediaTypeVersion.V2, ActuatorContext.ActuatorAndCloudFoundry); {{/CloudFoundry}} {{^CloudFoundry}} - services.AddCloudFoundryActuators(Configuration); + services.AddCloudFoundryActuators(Configuration); {{/CloudFoundry}} {{/Actuators}} {{#Discovery}} @@ -137,42 +137,39 @@ namespace {{ProjectNameSpace}} {{^TargetFrameworkVersion22}} services.AddMvc(); {{/TargetFrameworkVersion22}} - } -// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); } - {{#RequiresHttps}} - else + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) { - // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. - app.UseHsts(); + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + {{#RequiresHttps}} + else + { + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); + } + app.UseHttpsRedirection(); + {{/RequiresHttps}} + {{#Auth}} + app.UseAuthentication(); + {{/Auth}} + + {{#Actuators}} + {{#CloudFoundry}} + app.UseCloudFoundryActuators(MediaTypeVersion.V2, ActuatorContext.ActuatorAndCloudFoundry); + {{/CloudFoundry}} + {{^CloudFoundry}} + app.UseCloudFoundryActuators(); + {{/CloudFoundry}} + {{/Actuators}} + + {{#Discovery}} + app.UseDiscoveryClient(); + {{/Discovery}} + app.UseMvc(); } - - app.UseHttpsRedirection(); - {{/RequiresHttps}} - - - {{#Auth}} - app.UseAuthentication(); - {{/Auth}} - - {{#Actuators}} - {{#CloudFoundry}} - app.UseCloudFoundryActuators(MediaTypeVersion.V2, ActuatorContext.ActuatorAndCloudFoundry); - {{/CloudFoundry}} - {{^CloudFoundry}} - app.UseCloudFoundryActuators(); - {{/CloudFoundry}} - {{/Actuators}} - - {{#Discovery}} - app.UseDiscoveryClient(); - {{/Discovery}} - app.UseMvc(); } - } }