اجرای کامل یک پروژه blazor در یک مسیر مشخص در پروژه وب
نویسنده: ایمان محمدی
تاریخ: ۱۴۰۳/۱۲/۰۱ ۱۴:۲۴
آدرس: www.dntips.ir
// wwwroot/app1/index.html and other files
app.Map("/app1", blazor1App =>
{
blazor1App.Use(async (context, next) =>
{
if (!IsUrlWithExtension(context.Request.Path))
{
context.Request.Path = "/index.html";
}
await next();
});
});var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
await builder.Build().RunAsync();Blazor
.start()
.then(() => {
const containerElement = document.querySelector('#app')
return Blazor.rootComponents.add(containerElement, 'app', {});
})
.catch((error) => console.error(error));RootComponentرو چطور معرفی کنیم؟ حالا یکم روش کار می کنم ببینم چی میشه ممنون.