Files
immich-to-slideshow/src/ImmichToSlideshow/RequestPipeline/WebApplicationExtensions.cs
mikep@034E8FF1ED4D1F6 c4d42d79a0 DigiKam4 Archive
Change to only need the one json file and changed AppSettings to not need a binder file

Editorconfig for no new line before open braces

Nuget package bumps

Database lowest-version-history
2025-07-27 16:03:47 -07:00

21 lines
867 B
C#

using ImmichToSlideshow.Models;
namespace ImmichToSlideshow.RequestPipeline;
public static class WebApplicationExtensions {
public static WebApplication InitializeDatabase(this WebApplication webApplication) =>
// DBInitializer.Initialize(application.Configuration[DbConstants.DefaultConnectionStringPath]!);
webApplication;
public static WebApplication InitializeCorsAndHttps(this WebApplication webApplication, AppSettings appSettings) {
_ = webApplication.UseCors(corsPolicyBuilder =>
corsPolicyBuilder.WithOrigins(appSettings.WithOrigins).AllowAnyHeader().AllowAnyMethod());
if (appSettings.URLs.Contains("https", StringComparison.InvariantCultureIgnoreCase)) {
_ = webApplication.UseHttpsRedirection();
_ = webApplication.UseHsts();
}
return webApplication;
}
}