diff options
Diffstat (limited to 'dropped/docker/crupest-api/CrupestApi/CrupestApi.Commons/Config.cs')
-rw-r--r-- | dropped/docker/crupest-api/CrupestApi/CrupestApi.Commons/Config.cs | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/dropped/docker/crupest-api/CrupestApi/CrupestApi.Commons/Config.cs b/dropped/docker/crupest-api/CrupestApi/CrupestApi.Commons/Config.cs deleted file mode 100644 index 0ca3547..0000000 --- a/dropped/docker/crupest-api/CrupestApi/CrupestApi.Commons/Config.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace CrupestApi.Commons; - -public class CrupestApiConfig -{ - public string DataDir { get; set; } = string.Empty; -} - -public static class CrupestApiConfigExtensions -{ - public static IServiceCollection AddCrupestApiConfig(this IServiceCollection services) - { - services.AddOptions<CrupestApiConfig>().BindConfiguration("CrupestApi"); - services.PostConfigure<CrupestApiConfig>(config => - { - if (config.DataDir is null || config.DataDir.Length == 0) - { - config.DataDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "crupest-api"); - } - }); - - return services; - } -}
\ No newline at end of file |