fixed a logger init issue and added panel url

This commit is contained in:
2021-10-13 17:06:21 -04:00
parent 92f21896f9
commit bf937f7a2e
3 changed files with 12 additions and 3 deletions

View File

@@ -12,6 +12,13 @@ namespace WebAPI.Controllers
[ApiController]
public class HelloWorldController : ControllerBase
{
private readonly PterodactylService _pterodactylService;
public HelloWorldController(PterodactylService pterodactylService)
{
_pterodactylService = pterodactylService;
}
[HttpGet]
public async Task<string> HelloWorld()
{

View File

@@ -11,7 +11,7 @@ namespace WebAPI.Data
{
public class PterodactylService
{
[Inject] private ILogger logger { get; set; }
private ILogger logger { get; set; }
private HttpClient _client { get; set; }
private string _apiToken { get; set; }
private string _pterodactylHost { get; set; }
@@ -19,8 +19,9 @@ namespace WebAPI.Data
private string _applicationApiPath => "application/";
private string _clientApiPath => "client/";
public PterodactylService()
public PterodactylService(ILogger<PterodactylService> logger)
{
this.logger = logger;
_client = new HttpClient();
_apiToken = AppSettings.PterodactylAPIKey;
_pterodactylHost = AppSettings.PterodactylPanelURL;

View File

@@ -10,5 +10,6 @@
}
},
"AllowedHosts": "*",
"PterodactylAPIKey": "REPLACE_ME"
"PterodactylAPIKey": "REPLACE_ME",
"PterodactylPanelURL": "https://panel.orfl.xyz"
}