Remove snort/api

This commit is contained in:
2024-02-15 18:12:12 +00:00
parent 0cd0d5e425
commit 9f4daa9def
6 changed files with 26 additions and 68 deletions

View File

@ -8,6 +8,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using Nostr.Client.Client;
using NostrServices.Client;
using NostrStreamer.Database;
using NostrStreamer.Services;
using NostrStreamer.Services.Background;
@ -43,6 +44,11 @@ internal static class Program
var services = builder.Services;
var config = builder.Configuration.GetSection("Config").Get<Config>();
if (config == default)
{
throw new Exception("Config is missing!");
}
ConfigureDb(services, builder.Configuration);
services.AddCors();
services.AddMemoryCache();
@ -75,7 +81,7 @@ internal static class Program
o.DefaultPolicy = new AuthorizationPolicy(new[]
{
new ClaimsAuthorizationRequirement(ClaimTypes.Name, null)
}, new[] {NostrAuth.Scheme});
}, new[] { NostrAuth.Scheme });
});
services.AddDataProtection()
@ -119,13 +125,13 @@ internal static class Program
services.AddSingleton<PushSender>();
services.AddHostedService<PushSenderService>();
services.AddHostedService<EventStream>();
// webhooks
services.AddTransient<DiscordWebhook>();
// snort api
services.AddTransient<SnortApi>();
services.AddTransient<NostrServicesClient>();
var app = builder.Build();
using (var scope = app.Services.CreateScope())
@ -166,4 +172,4 @@ internal static class Program
return dummyHost;
}
}
}