-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
43 lines (31 loc) · 1.14 KB
/
Program.cs
File metadata and controls
43 lines (31 loc) · 1.14 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using EntraRadius.Models;
using EntraRadius.Services;
namespace EntraRadius
{
public class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Add health checks
builder.Services.AddHealthChecks();
// Configure EntraConfiguration from appsettings.json
builder.Services.Configure<EntraConfiguration>(
builder.Configuration.GetSection("EntraConfiguration"));
// Register services
builder.Services.AddMemoryCache();
builder.Services.AddSingleton<IUserCacheService, UserCacheService>();
builder.Services.AddScoped<GraphClientService>();
var app = builder.Build();
// Configure the HTTP request pipeline.
app.UseHttpsRedirection();
app.UseAuthorization();
// Map health check endpoint
app.MapHealthChecks("/health");
app.MapControllers();
app.Run();
}
}
}