mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
load port from config file for electron
This commit is contained in:
parent
b998c936ba
commit
a61f63b098
3
bin/www
3
bin/www
@ -16,9 +16,6 @@ const https = require('https');
|
|||||||
const config = require('../services/config');
|
const config = require('../services/config');
|
||||||
const log = require('../services/log');
|
const log = require('../services/log');
|
||||||
|
|
||||||
/**
|
|
||||||
* Get port from environment and store in Express.
|
|
||||||
*/
|
|
||||||
const port = normalizePort(config['Network']['port'] || '3000');
|
const port = normalizePort(config['Network']['port'] || '3000');
|
||||||
app.set('port', port);
|
app.set('port', port);
|
||||||
|
|
||||||
|
5
index.js
5
index.js
@ -1,6 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const electron = require('electron');
|
const electron = require('electron');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const config = require('./services/config');
|
||||||
|
|
||||||
const app = electron.app;
|
const app = electron.app;
|
||||||
|
|
||||||
@ -23,8 +24,10 @@ function createMainWindow() {
|
|||||||
icon: path.join(__dirname, 'public/images/app-icons/png/256x256.png')
|
icon: path.join(__dirname, 'public/images/app-icons/png/256x256.png')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const port = config['Network']['port'] || '3000';
|
||||||
|
|
||||||
win.setMenu(null);
|
win.setMenu(null);
|
||||||
win.loadURL('http://localhost:3000');
|
win.loadURL('http://localhost:' + port);
|
||||||
win.on('closed', onClosed);
|
win.on('closed', onClosed);
|
||||||
|
|
||||||
win.webContents.on('new-window', (e, url) => {
|
win.webContents.on('new-window', (e, url) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user