summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Startup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Web/Startup.cs')
-rw-r--r--src/SMAPI.Web/Startup.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/SMAPI.Web/Startup.cs b/src/SMAPI.Web/Startup.cs
index 53823771..31b5e61d 100644
--- a/src/SMAPI.Web/Startup.cs
+++ b/src/SMAPI.Web/Startup.cs
@@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Rewrite;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Options;
using MongoDB.Bson.Serialization;
using MongoDB.Driver;
using Newtonsoft.Json;
@@ -24,6 +25,7 @@ using StardewModdingAPI.Web.Framework.Clients.Pastebin;
using StardewModdingAPI.Web.Framework.Compression;
using StardewModdingAPI.Web.Framework.ConfigModels;
using StardewModdingAPI.Web.Framework.RewriteRules;
+using StardewModdingAPI.Web.Framework.Storage;
namespace StardewModdingAPI.Web
{
@@ -158,7 +160,13 @@ namespace StardewModdingAPI.Web
}
// init helpers
- services.AddSingleton<IGzipHelper>(new GzipHelper());
+ services
+ .AddSingleton<IGzipHelper>(new GzipHelper())
+ .AddSingleton<IStorageProvider>(serv => new StorageProvider(
+ serv.GetRequiredService<IOptions<ApiClientsConfig>>(),
+ serv.GetRequiredService<IPastebinClient>(),
+ serv.GetRequiredService<IGzipHelper>()
+ ));
}
/// <summary>The method called by the runtime to configure the HTTP request pipeline.</summary>