From 68d939049b37c5847de864b5dcab8d983483f8ec Mon Sep 17 00:00:00 2001 From: Sjory Date: Thu, 26 Dec 2024 14:58:39 +0100 Subject: kinda works made the create drinks website kinda work there is a problem with the api call to the server and it does not call correctly i expect there is a api endpoint wrong or smt like that also havent made a save drinks service yet it is commentet out --- Website/Website.Client/Program.cs | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'Website/Website.Client/Program.cs') diff --git a/Website/Website.Client/Program.cs b/Website/Website.Client/Program.cs index 519269f..d1f8c6e 100644 --- a/Website/Website.Client/Program.cs +++ b/Website/Website.Client/Program.cs @@ -1,5 +1,24 @@ using Microsoft.AspNetCore.Components.WebAssembly.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Net.Http; +using System.Threading.Tasks; +using Website.Client.Services; -var builder = WebAssemblyHostBuilder.CreateDefault(args); +namespace Website.Client +{ + public class Program + { + public static async Task Main(string[] args) + { + var builder = WebAssemblyHostBuilder.CreateDefault(args); + //builder.RootComponents.Add("#app"); + + builder.Services.AddSingleton(); // Register DrinkDataService + builder.Services.AddSingleton(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); + + await builder.Build().RunAsync(); + } + } +} -await builder.Build().RunAsync(); -- cgit v1.3.1