Program.cs 620 Bytes
Newer Older
1
2
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
3
4
using System;
using System.Net.Http;
5
using System.Threading.Tasks;
6
7
8
9
10

namespace BlazingPizza.Client
{
    public class Program
    {
11
        public static async Task Main(string[] args)
12
        {
13
14
            var builder = WebAssemblyHostBuilder.CreateDefault(args);
            builder.RootComponents.Add<App>("app");
15

16
            builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
17

18
19
            await builder.Build().RunAsync();
        }
20
21
    }
}