This commit is contained in:
Hananiel Sarella 2019-10-09 07:26:36 -05:00
Родитель 9dc887fd13 ef812d0180
Коммит f8cd2854bf
2 изменённых файлов: 34 добавлений и 37 удалений

Просмотреть файл

@ -47,7 +47,7 @@ namespace {{ProjectNameSpace}}.Controllers
[Route("api/[controller]")]
[ApiController]
public class ValuesController : ControllerBase
{
{
{{^MoreThanOneValuesControllerWithArgs}}
{{#SQLServer}}
private readonly SqlConnection _dbConnection;

Просмотреть файл

@ -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();
}
}
}