Skip to content

Commit

Permalink
update for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitchellscot committed Dec 19, 2023
1 parent a497f0b commit 580f5d8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,12 @@ private static void ConfigureMiddleware(IApplicationBuilder app)

});
}
app.UseHttpsRedirection();

app.UseStaticFiles();
app.UseHsts();
if (IsProduction())
if (!UseHttp())
{
app.UseHttpsRedirection();
app.UseHsts();
app.UseExceptionHandler("/Error");
app.UseMiddleware<IpAddressMiddleware>();
}
Expand Down Expand Up @@ -247,7 +248,7 @@ private static async void BootstrapElectron()
}

private static bool UseHttp()
=> _env.Equals(CashTrackEnv.Development, StringComparison.CurrentCultureIgnoreCase) || _env.Equals(CashTrackEnv.Docker, StringComparison.CurrentCultureIgnoreCase);
=> _env.Equals(CashTrackEnv.Electron, StringComparison.CurrentCultureIgnoreCase) || _env.Equals(CashTrackEnv.Docker, StringComparison.CurrentCultureIgnoreCase);
private static bool IsProduction()
=> _env.Equals(CashTrackEnv.Production, StringComparison.CurrentCultureIgnoreCase);
private static bool IsDocker()
Expand Down

0 comments on commit 580f5d8

Please sign in to comment.