All checks were successful
Restart Docker Container on Production / build (pull_request) Successful in 3m2s
53 lines
1.7 KiB
C#
53 lines
1.7 KiB
C#
using CommunityToolkit.Maui;
|
|
using CommunityToolkit.Maui.Markup;
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using RBLNews.Maui.Services;
|
|
using RBLNews.Shared.Models;
|
|
using RBLNews.Shared.Services;
|
|
using RBLNews.Shared.Services.Contracts;
|
|
|
|
namespace RBLNews.Maui
|
|
{
|
|
public static class MauiProgram
|
|
{
|
|
public static MauiApp CreateMauiApp()
|
|
{
|
|
var builder = MauiApp.CreateBuilder();
|
|
builder
|
|
.UseMauiApp<App>()
|
|
.UseMauiCommunityToolkit()
|
|
.UseMauiCommunityToolkitMarkup()
|
|
.ConfigureFonts(fonts =>
|
|
{
|
|
//fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
|
fonts.AddFont("NanumMyeongjo-Regular.ttf", "NanumMyeongjoRegular");
|
|
});
|
|
|
|
builder.Services.AddMauiBlazorWebView();
|
|
builder.Services.AddBlazorBootstrap();
|
|
builder.Services.AddSingleton<IConfigService, ConfigService>();
|
|
builder.Services.AddSingleton<IFeedDataService, FeedDataService>();
|
|
builder.Services.AddSingleton<AppLifecycleService>();
|
|
|
|
#if DEBUG
|
|
builder.Services.AddBlazorWebViewDeveloperTools();
|
|
builder.Logging.AddDebug();
|
|
#endif
|
|
|
|
MauiApp app = builder.Build();
|
|
|
|
AppSettingsModel? appSettings = app.Configuration.GetSection("App").Get<AppSettingsModel>();
|
|
|
|
if (string.IsNullOrEmpty(appSettings?.BackendApiUrl))
|
|
{
|
|
throw new Exception($"can't instantiate services, due to paramters are null. backendApiUrl: '{appSettings?.BackendApiUrl}'");
|
|
}
|
|
|
|
return app;
|
|
}
|
|
}
|
|
}
|