You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using HelloAgents.Web;
- using HelloAgents.Web.Components;
-
- var builder = WebApplication.CreateBuilder(args);
-
- // Add service defaults & Aspire components.
- builder.AddServiceDefaults();
-
- // Add services to the container.
- builder.Services.AddRazorComponents()
- .AddInteractiveServerComponents();
-
- builder.Services.AddOutputCache();
-
- builder.Services.AddHttpClient<AgentAPIClient>(client =>
- {
- // This URL uses "https+http://" to indicate HTTPS is preferred over HTTP.
- // Learn more about service discovery scheme resolution at https://aka.ms/dotnet/sdschemes.
- client.BaseAddress = new("https+http://apiservice");
- });
-
- var app = builder.Build();
-
- 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.UseOutputCache();
-
- app.MapRazorComponents<App>()
- .AddInteractiveServerRenderMode();
-
- app.MapDefaultEndpoints();
-
- app.Run();
|