IClientStartup implementation
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user