Config for the desktop app
All checks were successful
Build App / Build (push) Successful in 1m28s

This commit is contained in:
2024-03-16 13:38:46 +01:00
parent ede8ff088c
commit 88fb4935b5
5 changed files with 36 additions and 16 deletions

View File

@@ -2,7 +2,9 @@
using Avalonia.ReactiveUI;
using System;
using System.ComponentModel;
using System.IO;
using LaDOSE.REST;
using Microsoft.Extensions.Configuration;
using Splat;
// using Xilium.CefGlue;
// using Xilium.CefGlue.Common;
@@ -26,10 +28,15 @@ sealed class Program
private static void RegisterDependencies(IMutableDependencyResolver currentMutable, IReadonlyDependencyResolver current)
{
var builder = new ConfigurationBuilder()
.AddJsonFile("settings.json", optional: true, reloadOnChange: true).Build();
var restUrl = builder["REST:Url"].ToString();
var restUser = builder["REST:User"].ToString();
var restPassword = builder["REST:Password"].ToString();
currentMutable.RegisterLazySingleton<RestService>(()=>
{
var restService = new RestService();
restService.Connect(new Uri("http://localhost:5000"),"dev","dev");
restService.Connect(new Uri(restUrl),restUser,restPassword);
return restService;
});
}