-
Notifications
You must be signed in to change notification settings - Fork 15
/
Startup.cs
32 lines (26 loc) · 1.15 KB
/
Startup.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using Microsoft.Azure.Functions.Extensions.DependencyInjection;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using RainstormTech.Storm.ImageProxy;
using Microsoft.Azure.WebJobs.Host.Bindings;
using RainstormTech.Storm.ImageProxy.Extensions;
using RainstormTech.Storm.ImageProxy.Options;
[assembly: FunctionsStartup(typeof(Startup))]
namespace RainstormTech.Storm.ImageProxy
{
public class Startup : FunctionsStartup
{
public override void Configure(IFunctionsHostBuilder builder)
{
builder.Services
.AddOptions<ImageResizerOptions>()
.Configure<IConfiguration>((settings, configuration) => configuration.GetSection("ImageResizer").Bind(settings));
builder.Services
.AddOptions<ClientCacheOptions>()
.Configure<IConfiguration>((settings, configuration) => configuration.GetSection("ClientCache").Bind(settings));
builder.Services.AddHttpClient();
builder.Services.AddSingleton<IImageResizerService, ImageResizerService>();
builder.Services.FixConfiguration();
}
}
}