Skip to content

Commit

Permalink
extract delivery client configuration to settings file
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejch committed Nov 24, 2020
1 parent a005a73 commit 92f2d80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Program.cs
Expand Up @@ -2,6 +2,7 @@
using FromZeroToHero.Models;
using Kentico.Kontent.Delivery.Abstractions;
using Kentico.Kontent.Delivery.Extensions;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Statiq.App;
using Statiq.Common;
Expand All @@ -20,10 +21,7 @@ await Bootstrapper
// Add the type provider
services.AddSingleton<ITypeProvider, CustomTypeProvider>();
// Configure Delivery SDK
services.AddDeliveryClient(opts =>
opts.WithProjectId("cee1708b-4db8-0045-5b86-0135b747a1d4")
.UseProductionApi()
.Build());
services.AddDeliveryClient((IConfiguration)config);
})
.RunAsync();
}
Expand Down
5 changes: 5 additions & 0 deletions appsettings.json
@@ -0,0 +1,5 @@
{
"DeliveryOptions": {
"ProjectId": "cee1708b-4db8-0045-5b86-0135b747a1d4"
}
}

0 comments on commit 92f2d80

Please sign in to comment.