Recreated project with project template

This commit is contained in:
2024-12-05 15:35:23 +01:00
parent 7659403dc8
commit 3392407890
76 changed files with 2020 additions and 2922 deletions

View File

@@ -1,22 +0,0 @@
using MoonCore.Helpers;
using MoonlightServers.ApiServer.Database.Entities;
namespace MoonlightServers.ApiServer.Extensions;
public static class NodeExtensions
{
public static HttpApiClient CreateClient(this Node node)
{
var httpClient = new HttpClient(new HttpClientHandler() // TODO: Make global http config for proxy etc
{
UseProxy = false
});
var url = $"{(node.SslEnabled ? "https" : "http")}://{node.Fqdn}:{node.ApiPort}/";
httpClient.BaseAddress = new Uri(url);
httpClient.DefaultRequestHeaders.Add("Authorization", node.Token);
return new HttpApiClient(httpClient);
}
}