mirror of https://github.com/Squidex/squidex.git
14 changed files with 122 additions and 87 deletions
@ -0,0 +1,24 @@ |
|||||
|
// ==========================================================================
|
||||
|
// AppConfiguration.cs
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex Group
|
||||
|
// All rights reserved.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using Microsoft.Extensions.Configuration; |
||||
|
|
||||
|
namespace Squidex |
||||
|
{ |
||||
|
public static class AppConfiguration |
||||
|
{ |
||||
|
public static void AddAppConfiguration(this IConfigurationBuilder builder, string environmentName, string[] args) |
||||
|
{ |
||||
|
builder.Sources.Clear(); |
||||
|
builder.AddJsonFile("appsettings.json", true, true); |
||||
|
builder.AddJsonFile($"appsettings.{environmentName}.json", true); |
||||
|
builder.AddEnvironmentVariables(); |
||||
|
builder.AddCommandLine(args); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,53 @@ |
|||||
|
// ==========================================================================
|
||||
|
// Services.cs
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex Group
|
||||
|
// All rights reserved.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using Microsoft.Extensions.Configuration; |
||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
using Squidex.Config; |
||||
|
using Squidex.Config.Domain; |
||||
|
using Squidex.Config.Identity; |
||||
|
using Squidex.Config.Swagger; |
||||
|
using Squidex.Config.Web; |
||||
|
|
||||
|
namespace Squidex |
||||
|
{ |
||||
|
public static class AppServices |
||||
|
{ |
||||
|
public static void AddAppServices(this IServiceCollection services, IConfiguration config) |
||||
|
{ |
||||
|
services.AddLogging(); |
||||
|
services.AddMemoryCache(); |
||||
|
services.AddOptions(); |
||||
|
|
||||
|
services.AddMyAssetServices(config); |
||||
|
services.AddMyAuthentication(config); |
||||
|
services.AddMyDataProtectection(config); |
||||
|
services.AddMyEventPublishersServices(config); |
||||
|
services.AddMyEventStoreServices(config); |
||||
|
services.AddMyIdentity(); |
||||
|
services.AddMyIdentityServer(); |
||||
|
services.AddMyInfrastructureServices(config); |
||||
|
services.AddMyMvc(); |
||||
|
services.AddMyPubSubServices(config); |
||||
|
services.AddMyReadServices(config); |
||||
|
services.AddMySerializers(); |
||||
|
services.AddMyStoreServices(config); |
||||
|
services.AddMySwaggerSettings(); |
||||
|
services.AddMyWriteServices(); |
||||
|
|
||||
|
services.Configure<MyUrlsOptions>( |
||||
|
config.GetSection("urls")); |
||||
|
services.Configure<MyIdentityOptions>( |
||||
|
config.GetSection("identity")); |
||||
|
services.Configure<MyUIOptions>( |
||||
|
config.GetSection("ui")); |
||||
|
services.Configure<MyUsageOptions>( |
||||
|
config.GetSection("usage")); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue