IClientStartup implementation

This commit is contained in:
Pavel Vesely
2020-05-11 13:10:22 +02:00
parent 7c814a67b3
commit da73d519d7
7 changed files with 80 additions and 12 deletions

View File

@ -19,7 +19,8 @@ using Oqtane.Infrastructure;
using Oqtane.Repository;
using Oqtane.Security;
using Oqtane.Services;
using Oqtane.Shared;
using Oqtane.Shared;
using Oqtane.UI;
namespace Oqtane
{
@ -27,6 +28,7 @@ namespace Oqtane
{
public IConfigurationRoot Configuration { get; }
private string _webRoot;
private Runtime _runtime;
public Startup(IWebHostEnvironment env)
{
@ -34,6 +36,9 @@ namespace Oqtane
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
Configuration = builder.Build();
_runtime = (Configuration.GetSection("Runtime").Value == "WebAssembly") ? Runtime.WebAssembly : Runtime.Server;
_webRoot = env.WebRootPath;
AppDomain.CurrentDomain.SetData("DataDirectory", Path.Combine(env.ContentRootPath, "Data"));
}
@ -189,7 +194,7 @@ namespace Oqtane
services.AddTransient<IUpgradeManager, UpgradeManager>();
// load the external assemblies into the app domain, install services
services.AddOqtaneParts();
services.AddOqtaneParts(_runtime);
services.AddMvc()
.AddNewtonsoftJson()