moved helpers to primary ctor

This commit is contained in:
CWX
2025-01-18 20:11:08 +00:00
parent 9b60f10725
commit 3402f94398
25 changed files with 457 additions and 730 deletions
+2 -7
View File
@@ -7,9 +7,9 @@ using Core.Servers;
namespace Core.Helpers;
[Injectable(InjectionType.Singleton)]
public class HttpServerHelper
public class HttpServerHelper(ConfigServer configServer)
{
protected HttpConfig _httpConfig;
protected HttpConfig _httpConfig = configServer.GetConfig<HttpConfig>();
protected Dictionary<string, string> mime = new()
{
@@ -24,11 +24,6 @@ public class HttpServerHelper
{ "txt", "text/plain" }
};
public HttpServerHelper(ConfigServer configServer)
{
_httpConfig = configServer.GetConfig<HttpConfig>();
}
public string GetMimeText(string key)
{
return mime[key];