Spotify.NET/SpotifyAPI.Web.Examples/Example.BlazorWASM/Program.cs

22 lines
574 B
C#
Raw Normal View History

2020-06-04 13:42:16 +01:00
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace Example.BlazorWASM
{
2020-11-14 08:47:00 +00:00
public class Program
{
public static async Task Main(string[] args)
2020-06-04 13:42:16 +01:00
{
2020-11-14 08:47:00 +00:00
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
2020-06-04 13:42:16 +01:00
2020-11-14 08:47:00 +00:00
builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
2020-06-04 13:42:16 +01:00
2020-11-14 08:47:00 +00:00
await builder.Build().RunAsync();
2020-06-04 13:42:16 +01:00
}
2020-11-14 08:47:00 +00:00
}
2020-06-04 13:42:16 +01:00
}