MyBookmark/MyBookmark.UI.RazorPages/Program.cs
THE_KONDRAT bad2805994 title modification
tried to add some ui
2024-09-24 19:44:54 +03:00

37 lines
1.2 KiB
C#

using MyBookmark.UI.RazorPages.Clients.Library.Genre;
using MyBookmark.UI.RazorPages.Clients.Library.Language;
using MyBookmark.UI.RazorPages.Clients.Library.MediaContent.Anime.Title;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorPages();
var u = builder.Configuration.GetValue<string>("ClientUrls:Library") ?? throw new Exception("n");
builder.Services.AddHttpClient<ILanguageClient, LanguageClient>()
.ConfigureHttpClient(q => q.BaseAddress = new Uri(u));
builder.Services.AddHttpClient<IGenreClient, GenreClient>()
.ConfigureHttpClient(q => q.BaseAddress = new Uri(u));
builder.Services.AddHttpClient<ITitleClient, TitleClient>()
.ConfigureHttpClient(q => q.BaseAddress = new Uri(u));
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapRazorPages();
app.Run();