-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
28 lines (26 loc) · 1.05 KB
/
Program.cs
File metadata and controls
28 lines (26 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using Common;
using HealthChecks.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using NHS.Screening.RemoveParticipant;
var host = new HostBuilder()
.AddConfiguration<RemoveParticipantConfig>(out RemoveParticipantConfig config)
.ConfigureFunctionsWorkerDefaults()
.ConfigureServices(services =>
{
services.AddSingleton<ICallFunction, CallFunction>();
services.AddSingleton<ICreateResponse, CreateResponse>();
services.AddSingleton<ICheckDemographic, CheckDemographic>();
services.AddSingleton<ICreateParticipant, CreateParticipant>();
services.AddSingleton<ICohortDistributionHandler, CohortDistributionHandler>();
services.AddHttpClient<ICheckDemographic, CheckDemographic>(client =>
{
client.BaseAddress = new Uri(config.DemographicURIGet);
});
// Register health checks
services.AddBasicHealthCheck("RemoveParticipant");
})
.AddAzureQueues()
.AddExceptionHandler()
.Build();
await host.RunAsync();