Files
SPT-Server-Build/Core/Callbacks/HttpCallbacks.cs
T
2025-01-11 18:30:38 +00:00

35 lines
937 B
C#

using Core.Annotations;
using Core.Context;
using Core.DI;
using Core.Servers;
namespace Core.Callbacks;
[Injectable(InjectionType.Singleton, InjectableTypeOverride = typeof(OnLoad), TypePriority = OnLoadOrder.HttpCallbacks)]
public class HttpCallbacks : OnLoad
{
private readonly HttpServer _httpServer;
private readonly ApplicationContext _applicationContext;
public HttpCallbacks(HttpServer httpServer, ApplicationContext applicationContext)
{
_httpServer = httpServer;
_applicationContext = applicationContext;
}
public async Task OnLoad()
{
_httpServer.Load((WebApplicationBuilder) _applicationContext.GetLatestValue(ContextVariableType.APP_BUILDER).Value);
_applicationContext.ClearValues(ContextVariableType.APP_BUILDER);
}
public string GetRoute()
{
return "spt-http";
}
public string GetImage()
{
return "";
}
}