fixed a logger init issue and added panel url
This commit is contained in:
@@ -12,6 +12,13 @@ namespace WebAPI.Controllers
|
|||||||
[ApiController]
|
[ApiController]
|
||||||
public class HelloWorldController : ControllerBase
|
public class HelloWorldController : ControllerBase
|
||||||
{
|
{
|
||||||
|
private readonly PterodactylService _pterodactylService;
|
||||||
|
|
||||||
|
public HelloWorldController(PterodactylService pterodactylService)
|
||||||
|
{
|
||||||
|
_pterodactylService = pterodactylService;
|
||||||
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<string> HelloWorld()
|
public async Task<string> HelloWorld()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace WebAPI.Data
|
|||||||
{
|
{
|
||||||
public class PterodactylService
|
public class PterodactylService
|
||||||
{
|
{
|
||||||
[Inject] private ILogger logger { get; set; }
|
private ILogger logger { get; set; }
|
||||||
private HttpClient _client { get; set; }
|
private HttpClient _client { get; set; }
|
||||||
private string _apiToken { get; set; }
|
private string _apiToken { get; set; }
|
||||||
private string _pterodactylHost { get; set; }
|
private string _pterodactylHost { get; set; }
|
||||||
@@ -19,8 +19,9 @@ namespace WebAPI.Data
|
|||||||
private string _applicationApiPath => "application/";
|
private string _applicationApiPath => "application/";
|
||||||
private string _clientApiPath => "client/";
|
private string _clientApiPath => "client/";
|
||||||
|
|
||||||
public PterodactylService()
|
public PterodactylService(ILogger<PterodactylService> logger)
|
||||||
{
|
{
|
||||||
|
this.logger = logger;
|
||||||
_client = new HttpClient();
|
_client = new HttpClient();
|
||||||
_apiToken = AppSettings.PterodactylAPIKey;
|
_apiToken = AppSettings.PterodactylAPIKey;
|
||||||
_pterodactylHost = AppSettings.PterodactylPanelURL;
|
_pterodactylHost = AppSettings.PterodactylPanelURL;
|
||||||
|
|||||||
@@ -10,5 +10,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"PterodactylAPIKey": "REPLACE_ME"
|
"PterodactylAPIKey": "REPLACE_ME",
|
||||||
|
"PterodactylPanelURL": "https://panel.orfl.xyz"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user