Small Cleaning and autorun bug fix

This commit is contained in:
Myx
2022-01-02 05:45:05 +01:00
parent bcdab6b162
commit 3140a78f00
48 changed files with 208 additions and 698 deletions

View File

@@ -1,4 +1,4 @@
const { app, BrowserWindow, dialog } = require('electron')
const { app, dialog } = require('electron')
const system = require('electron-shutdown-command');
const express = require('express')
const cors = require('cors');
@@ -9,6 +9,8 @@ const firstRun = require('electron-first-run');
const autoLaunch = new AutoLaunch({
name: 'GoToBed Server',
path: process.env.PORTABLE_EXECUTABLE_DIR + '/GoToBed.exe',
});
const paramPort = app.commandLine.getSwitchValue("port") == "" ? "3000" : app.commandLine.getSwitchValue("port");
const isFirstRun = firstRun();
@@ -27,7 +29,6 @@ server.use(cors({
exposedHeaders: ['Access-Control-Allow-Origin', '*'],
}))
server.post('/commandbridge', function (req, res) {
console.log(req.body.command)
switch (req.body.command) {
case 'shutdown':
console.log('shutting down')