From a61f63b098724e982be4743aee92ed501425c070 Mon Sep 17 00:00:00 2001 From: azivner Date: Mon, 20 Nov 2017 19:59:42 -0500 Subject: [PATCH] load port from config file for electron --- bin/www | 3 --- index.js | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/www b/bin/www index cd21bae31..9d2f738c0 100755 --- a/bin/www +++ b/bin/www @@ -16,9 +16,6 @@ const https = require('https'); const config = require('../services/config'); const log = require('../services/log'); -/** - * Get port from environment and store in Express. - */ const port = normalizePort(config['Network']['port'] || '3000'); app.set('port', port); diff --git a/index.js b/index.js index 49c2298b0..71c1279a2 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,7 @@ 'use strict'; const electron = require('electron'); const path = require('path'); +const config = require('./services/config'); const app = electron.app; @@ -23,8 +24,10 @@ function createMainWindow() { icon: path.join(__dirname, 'public/images/app-icons/png/256x256.png') }); + const port = config['Network']['port'] || '3000'; + win.setMenu(null); - win.loadURL('http://localhost:3000'); + win.loadURL('http://localhost:' + port); win.on('closed', onClosed); win.webContents.on('new-window', (e, url) => {