mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-24 22:58:28 +01:00
22 lines
697 B
C#
22 lines
697 B
C#
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace BTCPayServer.Controllers;
|
|
|
|
public static class BTCPayAppExtensions
|
|
{
|
|
public static IServiceCollection AddBTCPayApp(this IServiceCollection serviceCollection)
|
|
{
|
|
serviceCollection.AddSingleton<BTCPayAppState>();
|
|
serviceCollection.AddHostedService(serviceProvider => serviceProvider.GetRequiredService<BTCPayAppState>());
|
|
return serviceCollection;
|
|
}
|
|
|
|
public static void UseBTCPayApp(this IApplicationBuilder builder)
|
|
{
|
|
builder.UseEndpoints(routeBuilder =>
|
|
{
|
|
routeBuilder.MapHub<BTCPayAppHub>("hub/btcpayapp");
|
|
});
|
|
}
|
|
}
|