mirror of
https://github.com/farcasclaudiu/BlazorDeviceInterop.git
synced 2026-06-22 13:01:08 +03:00
25 lines
758 B
C#
25 lines
758 B
C#
using System;
|
|
using System.Net.Http;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Darnton.Blazor.DeviceInterop.Geolocation;
|
|
|
|
namespace BlazorDeviceTestRig
|
|
{
|
|
public class Program
|
|
{
|
|
public static async Task Main(string[] args)
|
|
{
|
|
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
|
builder.RootComponents.Add<App>("app");
|
|
|
|
builder.Services.AddScoped<IGeolocationService, GeolocationService>();
|
|
|
|
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
|
|
|
await builder.Build().RunAsync();
|
|
}
|
|
}
|
|
}
|