mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
More server code
This commit is contained in:
parent
779e178bfe
commit
6af400369d
@ -21,4 +21,5 @@ public class AppSettings
|
||||
public string AuthoredFilesFolder { get; set; }
|
||||
public string MetricsFolder { get; set; }
|
||||
public string TarLogPath { get; set; }
|
||||
public string GitHubKey { get; set; }
|
||||
}
|
@ -63,7 +63,15 @@ public class Startup
|
||||
services.AddSingleton<AuthorFiles>();
|
||||
services.AddSingleton<AuthorKeys>();
|
||||
services.AddSingleton<Client>();
|
||||
services.AddSingleton(s => new GitHubClient(new ProductHeaderValue("wabbajack")));
|
||||
services.AddSingleton(s =>
|
||||
{
|
||||
var settings = s.GetService<AppSettings>()!;
|
||||
if (string.IsNullOrWhiteSpace(settings.GitHubKey))
|
||||
return new GitHubClient(new ProductHeaderValue("wabbajack"));
|
||||
|
||||
var creds = new Credentials(settings.GitHubKey);
|
||||
return new GitHubClient(new ProductHeaderValue("wabbajack")) {Credentials = creds};
|
||||
});
|
||||
services.AddDTOSerializer();
|
||||
services.AddDTOConverters();
|
||||
services.AddResponseCompression(options =>
|
||||
|
Loading…
Reference in New Issue
Block a user