Feat/usage stats collection (#317)
* feat: implement anonymous usage data collection Co-authored-by: Joseph Milazzo <joseph.v.milazzo@gmail.com>
This commit is contained in:
parent
b25335acbd
commit
1c9b2572ae
23 changed files with 613 additions and 17 deletions
|
|
@ -1,4 +1,7 @@
|
|||
using API.Interfaces.Services;
|
||||
using System;
|
||||
using API.Interfaces.Services;
|
||||
using API.Services.Clients;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace API.Extensions
|
||||
|
|
@ -8,5 +11,16 @@ namespace API.Extensions
|
|||
public static IServiceCollection AddStartupTask<T>(this IServiceCollection services)
|
||||
where T : class, IStartupTask
|
||||
=> services.AddTransient<IStartupTask, T>();
|
||||
|
||||
public static IServiceCollection AddStatsClient(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.AddHttpClient<StatsApiClient>(client =>
|
||||
{
|
||||
client.BaseAddress = new Uri("http://stats.kavitareader.com");
|
||||
client.DefaultRequestHeaders.Add("api-key", "MsnvA2DfQqxSK5jh");
|
||||
});
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue