Disable HTTPS redirect
This commit is contained in:
@@ -15,7 +15,7 @@ namespace EstusShots.Server
|
|||||||
public IConfiguration Configuration { get; }
|
public IConfiguration Configuration { get; }
|
||||||
|
|
||||||
private bool IsDevelopment { get; set; }
|
private bool IsDevelopment { get; set; }
|
||||||
|
|
||||||
public Startup(IConfiguration configuration)
|
public Startup(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
Configuration = configuration;
|
Configuration = configuration;
|
||||||
@@ -34,14 +34,11 @@ namespace EstusShots.Server
|
|||||||
services.AddControllers().AddJsonOptions(options =>
|
services.AddControllers().AddJsonOptions(options =>
|
||||||
{
|
{
|
||||||
options.JsonSerializerOptions.PropertyNameCaseInsensitive = true;
|
options.JsonSerializerOptions.PropertyNameCaseInsensitive = true;
|
||||||
if (IsDevelopment)
|
if (IsDevelopment) options.JsonSerializerOptions.WriteIndented = true;
|
||||||
{
|
|
||||||
options.JsonSerializerOptions.WriteIndented = true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
services.AddSwaggerGen(options =>
|
services.AddSwaggerGen(options =>
|
||||||
{
|
{
|
||||||
options.SwaggerDoc("v1", new OpenApiInfo { Title = "Estus Shots API", Version = "v1" });
|
options.SwaggerDoc("v1", new OpenApiInfo {Title = "Estus Shots API", Version = "v1"});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Register business logic services
|
// Register business logic services
|
||||||
@@ -54,23 +51,17 @@ namespace EstusShots.Server
|
|||||||
{
|
{
|
||||||
IsDevelopment = env.IsDevelopment();
|
IsDevelopment = env.IsDevelopment();
|
||||||
if (IsDevelopment)
|
if (IsDevelopment)
|
||||||
{
|
|
||||||
app.UseDeveloperExceptionPage();
|
app.UseDeveloperExceptionPage();
|
||||||
}
|
|
||||||
else
|
// Do not Redirect for now. Breaks local tests.
|
||||||
{
|
// app.UseHttpsRedirection();
|
||||||
app.UseHttpsRedirection();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Enable middleware to serve generated Swagger as a JSON endpoint.
|
// Enable middleware to serve generated Swagger as a JSON endpoint.
|
||||||
app.UseSwagger();
|
app.UseSwagger();
|
||||||
|
|
||||||
// Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.),
|
// Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.),
|
||||||
// specifying the Swagger JSON endpoint.
|
// specifying the Swagger JSON endpoint.
|
||||||
app.UseSwaggerUI(c =>
|
app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "Estus Shots API V1"); });
|
||||||
{
|
|
||||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "Estus Shots API V1");
|
|
||||||
});
|
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|||||||
Reference in New Issue
Block a user