/
coderlivingdeath
/
SimpleQuiz
Обзор
Документация
Войти
/
coderlivingdeath
/
SimpleQuiz
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
SimpleQuizClient/Program.cs
29 строк
790 B
fxk
Create simple blazor server client
23 янв 2025, 20:19
23 янв 2025, 20:19
40c125f
Код
Авторство
О чём код?
using SimpleQuizClient.Components; var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddRazorComponents() .AddInteractiveServerComponents(); builder.Services.AddScoped(serviceType => new HttpClient {BaseAddress = new Uri("http://localhost:5005")}); var app = builder.Build(); // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Error", createScopeForErrors: true); // 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.UseAntiforgery(); app.MapRazorComponents<App>() .AddInteractiveServerRenderMode(); app.Run();