mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-08-13 11:39:52 +00:00
maybe i broke it...
This commit is contained in:
@@ -9,7 +9,8 @@ app.on('ready', () => {
|
||||
const process = require('child_process').spawn;
|
||||
|
||||
// run server
|
||||
var apipath = path.join(__dirname, '\\bin\\ElectronNET.WebApp.exe');
|
||||
// ToDo: The .exe name may vary. The most simple solution would be to locate the first .exe in the given directory
|
||||
var apipath = path.join(__dirname, '\\bin\\ElectronNET.WebApp.exe /electronized=true');
|
||||
apiProcess = process(apipath);
|
||||
|
||||
apiProcess.stdout.on('data', (data) => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace ElectronNET.WebApp
|
||||
{
|
||||
@@ -13,10 +14,38 @@ namespace ElectronNET.WebApp
|
||||
|
||||
// WICHTIG! UseContentRoot auf Assembly Ordner Essentiell!
|
||||
// Ggf. kann man via Parameter den Content Root durchreichen?
|
||||
public static IWebHost BuildWebHost(string[] args) =>
|
||||
WebHost.CreateDefaultBuilder(args)
|
||||
.UseContentRoot(AppDomain.CurrentDomain.BaseDirectory)
|
||||
.UseStartup<Startup>()
|
||||
.Build();
|
||||
public static IWebHost BuildWebHost(string[] args)
|
||||
{
|
||||
// ToDo: Maybe add a "electronized" args check here?
|
||||
// this is the electron case!
|
||||
if (args.Length > 0)
|
||||
{
|
||||
Console.WriteLine("Test Switch for Electron detection: " + args[0]);
|
||||
return WebHost.CreateDefaultBuilder(args)
|
||||
.UseContentRoot(AppDomain.CurrentDomain.BaseDirectory)
|
||||
.UseStartup<Startup>()
|
||||
.Build();
|
||||
}
|
||||
else
|
||||
{
|
||||
return WebHost.CreateDefaultBuilder(args)
|
||||
.UseStartup<Startup>()
|
||||
.Build();
|
||||
}
|
||||
|
||||
// this didn't work... its too late, idk...
|
||||
//var builder = WebHost.CreateDefaultBuilder(args);
|
||||
|
||||
//if (args.Length > 0)
|
||||
//{
|
||||
// // ToDo: Maybe add a "electronized" args check here?
|
||||
// Console.WriteLine("Test Switch for Electron detection: " + args[0]);
|
||||
// builder = builder.UseContentRoot(AppDomain.CurrentDomain.BaseDirectory);
|
||||
//}
|
||||
|
||||
//builder = builder.UseStartup<Startup>();
|
||||
|
||||
//return builder.Build();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user