-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
53 lines (44 loc) · 1.43 KB
/
Program.cs
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
44
45
46
47
48
49
50
51
52
53
using Kontent.Ai.Delivery;
using Kontent.Ai.Delivery.Abstractions;
using Kontent.Ai.Delivery.Extensions;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.FeatureManagement;
using RowlingApp.Models.Generated;
using RowlingApp.Services;
var builder = WebApplication.CreateBuilder(args);
// Application services and configuration setup
var Configuration = builder.Configuration;
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddFeatureManagement();
builder.Services.AddSingleton<ITypeProvider, CustomTypeProvider>();
builder.Services.AddHttpClient<IDeliveryHttpClient, DeliveryHttpClient>();
builder.Services.AddDeliveryClient(Configuration);
//builder.Services.AddHttpClient<KontentManagementBetaService>();
builder.Services.AddSingleton<KontentManagementService>();
builder.Services.AddSingleton<TeamService>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseAzureAppConfiguration();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapBlazorHub();
endpoints.MapFallbackToPage("/_Host");
});
app.Run();