From 3f3a532a9ffdaa424fef0dc35303d8427f70a18d Mon Sep 17 00:00:00 2001 From: luxick Date: Sat, 29 Feb 2020 23:57:56 +0100 Subject: [PATCH 1/2] Disable HTTPS redirect --- EstusShots.Server/Startup.cs | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/EstusShots.Server/Startup.cs b/EstusShots.Server/Startup.cs index 3772acd..4a40dd6 100644 --- a/EstusShots.Server/Startup.cs +++ b/EstusShots.Server/Startup.cs @@ -15,7 +15,7 @@ namespace EstusShots.Server public IConfiguration Configuration { get; } private bool IsDevelopment { get; set; } - + public Startup(IConfiguration configuration) { Configuration = configuration; @@ -34,14 +34,11 @@ namespace EstusShots.Server services.AddControllers().AddJsonOptions(options => { options.JsonSerializerOptions.PropertyNameCaseInsensitive = true; - if (IsDevelopment) - { - options.JsonSerializerOptions.WriteIndented = true; - } + if (IsDevelopment) options.JsonSerializerOptions.WriteIndented = true; }); 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 @@ -54,23 +51,17 @@ namespace EstusShots.Server { IsDevelopment = env.IsDevelopment(); if (IsDevelopment) - { app.UseDeveloperExceptionPage(); - } - else - { - app.UseHttpsRedirection(); - } + + // Do not Redirect for now. Breaks local tests. + // app.UseHttpsRedirection(); // Enable middleware to serve generated Swagger as a JSON endpoint. app.UseSwagger(); // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), // specifying the Swagger JSON endpoint. - app.UseSwaggerUI(c => - { - c.SwaggerEndpoint("/swagger/v1/swagger.json", "Estus Shots API V1"); - }); + app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "Estus Shots API V1"); }); app.UseRouting(); app.UseAuthorization(); From 0b7e4ac7e0d294c582fb47fa603bf99ad272ca90 Mon Sep 17 00:00:00 2001 From: luxick Date: Sat, 29 Feb 2020 23:58:08 +0100 Subject: [PATCH 2/2] Update publish.sh --- publish.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/publish.sh b/publish.sh index 9a2bb9e..e10a18b 100755 --- a/publish.sh +++ b/publish.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# Clean up +echo "Cleaning up build directory" +[ -d "Publish" ] && rm -r Publish + # Publish Server echo "Running dotnet publish for server" dotnet publish \