/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Components/test/testassets/Components.TestServer/ClientStartup.cs
48 строк
1 KB
Javier Calvarro Nelson
[Blazor] Replace Blazor WebAssembly DevServer with Gateway in templates (#66729)
19 май 2026, 20:45
Не верифицирован
19 май 2026, 20:45
b24ff65
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace TestServer; // WARNING: DO NOT MODIFY THIS STARTUP CLASS FOR TEST PURPOSES // Most of the client-side tests are executed using the developer host directly, so changing values here won't // affect any client-side test. public class ClientStartup { public ClientStartup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddServerSideBlazor(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } // Mount the server-side Blazor app on /subdir app.Map("/subdir", app => { app.UseBlazorFrameworkFiles(); app.UseStaticFiles(); app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); endpoints.MapControllers(); endpoints.MapFallbackToFile("index.html"); }); }); } }