mirror of
https://github.com/zadam/trilium.git
synced 2024-12-25 00:34:08 +08:00
load port from config file for electron
This commit is contained in:
parent
b998c936ba
commit
a61f63b098
2 changed files with 4 additions and 4 deletions
3
bin/www
3
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);
|
||||
|
||||
|
|
5
index.js
5
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) => {
|
||||
|
|
Loading…
Reference in a new issue