Skip to content

Instantly share code, notes, and snippets.

@huanlin
Created December 16, 2022 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huanlin/949d79abf872fab0206bddba3f2cc4af to your computer and use it in GitHub Desktop.
Save huanlin/949d79abf872fab0206bddba3f2cc4af to your computer and use it in GitHub Desktop.
Blazor entry point (Main method)
using BlazorApp.Client;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment