41 lines
993 B
C#
41 lines
993 B
C#
using Bimix.UI.Shared.Extensions;
|
|
using Microsoft.Extensions.Logging;
|
|
using MudBlazor.Services;
|
|
|
|
namespace Bimix.UI.Mobile;
|
|
|
|
public static class MauiProgram
|
|
{
|
|
public static MauiApp CreateMauiApp()
|
|
{
|
|
var builder = MauiApp.CreateBuilder();
|
|
builder
|
|
.UseMauiApp<App>()
|
|
.ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); });
|
|
|
|
builder.Services.AddMauiBlazorWebView();
|
|
|
|
builder.Services.AddMudServices();
|
|
|
|
var baseUrl = GetApiBaseUrl();
|
|
builder.Services.AddSharedServices(baseUrl);
|
|
|
|
|
|
#if DEBUG
|
|
builder.Services.AddBlazorWebViewDeveloperTools();
|
|
builder.Logging.AddDebug();
|
|
#endif
|
|
return builder.Build();
|
|
}
|
|
|
|
private static string GetApiBaseUrl()
|
|
{
|
|
#if IOS
|
|
// iOS symulator - użyj swojego IP
|
|
return "http://192.168.13.44:7142/"; // Zastąp swoim IP
|
|
#else
|
|
return "https://localhost:7142/";
|
|
#endif
|
|
}
|
|
|
|
} |