// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, DubStatsContext db, IPackageManager p) { db.Database.Migrate(); var package = p.GetPackageByNameOrNullAsync("jcli").Result; if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseStatusCodePages(); } else { app.UseHsts(); } app.UseStaticFiles(); app.UseGraphQL <DubStatsSchema>("/graphql"); app.UseGraphQLPlayground(new GraphQLPlaygroundOptions { PlaygroundSettings = new Dictionary <string, object> { { "request.credentials", "same-origin" } } }); app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public DubRegistryStatFetcher( DubStatsContext db, ILogger <DubRegistryStatFetcher> logger, IWeekManager weeks, IUpdateManager updates ) { this._db = db; this._logger = logger; this._weeks = weeks; this._updates = updates; this._client = new HttpClient(); this._client.BaseAddress = Constants.STAT_FETCHER_BASE_ADDRESS; this._client.DefaultRequestHeaders.Add("user-agent", Constants.STAT_FETCHER_USER_AGENT); }
public UpdateManager(DubStatsContext db, ILogger <UpdateManager> logger) { this._db = db; this._logger = logger; }
public WeekManager(DubStatsContext db) { this._db = db; }