Additions to api, removal of blazor project for now
This commit is contained in:
@@ -6,6 +6,7 @@ namespace WebAPI.Data
|
||||
public static class AppSettings
|
||||
{
|
||||
public static string PterodactylAPIKey { get; private set; }
|
||||
public static string PterodactylPanelURL { get; private set; }
|
||||
public static void Init(IConfiguration configuration)
|
||||
{
|
||||
var fields = typeof(AppSettings).GetProperties();
|
||||
|
||||
18
WebAPI/Data/PterodactylService.cs
Normal file
18
WebAPI/Data/PterodactylService.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Net.Http;
|
||||
|
||||
namespace WebAPI.Data
|
||||
{
|
||||
public class PterodactylService
|
||||
{
|
||||
private HttpClient _client { get; set; }
|
||||
private string _apiToken { get; set; }
|
||||
|
||||
public PterodactylService()
|
||||
{
|
||||
_client = new HttpClient();
|
||||
_apiToken = AppSettings.PterodactylAPIKey;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,7 @@ namespace WebAPI
|
||||
services.AddControllers();
|
||||
services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo {Title = "Petrie Panel Web API", Version = "v1"}); });
|
||||
services.AddDbContext<AppDbContext>(options => options.UseNpgsql(Configuration.GetConnectionString("DefaultConnection")));
|
||||
services.AddSingleton<PterodactylService>();
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
|
||||
Reference in New Issue
Block a user