diff options
author | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-08-08 00:01:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-08 05:31:37 +0530 |
commit | 97d51a7763b14c92ee71ff9a012311dd9498d803 (patch) | |
tree | bd36005031ecb1148f27aa541e7a92a5e3aa4c0c /src/electron/ipc-api/localServer.js | |
parent | 5.6.1-nightly.17 [skip ci] (diff) | |
download | ferdium-app-97d51a7763b14c92ee71ff9a012311dd9498d803.tar.gz ferdium-app-97d51a7763b14c92ee71ff9a012311dd9498d803.tar.zst ferdium-app-97d51a7763b14c92ee71ff9a012311dd9498d803.zip |
refactor: path-references refactoring and using 'import' instead of 'require' (#1752)
* refactor references to 'userData' and 'appData' directories to move hardcoding into single location
* convert to es6 for lower memory usage as per https://codesource.io/the-difference-between-import-and-require-in-javascript/
Diffstat (limited to 'src/electron/ipc-api/localServer.js')
-rw-r--r-- | src/electron/ipc-api/localServer.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/electron/ipc-api/localServer.js b/src/electron/ipc-api/localServer.js index 493253e17..1ed4b7167 100644 --- a/src/electron/ipc-api/localServer.js +++ b/src/electron/ipc-api/localServer.js | |||
@@ -1,6 +1,7 @@ | |||
1 | import { ipcMain, app } from 'electron'; | 1 | import { ipcMain } from 'electron'; |
2 | import net from 'net'; | 2 | import net from 'net'; |
3 | import { LOCAL_HOSTNAME } from '../../config'; | 3 | import { LOCAL_HOSTNAME } from '../../config'; |
4 | import { userDataPath } from '../../environment'; | ||
4 | import startServer from '../../internal-server/start'; | 5 | import startServer from '../../internal-server/start'; |
5 | 6 | ||
6 | const DEFAULT_PORT = 45569; | 7 | const DEFAULT_PORT = 45569; |
@@ -37,7 +38,7 @@ export default (params) => { | |||
37 | } | 38 | } |
38 | console.log('Starting local server on port', port); | 39 | console.log('Starting local server on port', port); |
39 | 40 | ||
40 | startServer(app.getPath('userData'), port); | 41 | startServer(userDataPath(), port); |
41 | 42 | ||
42 | params.mainWindow.webContents.send('localServerPort', { | 43 | params.mainWindow.webContents.send('localServerPort', { |
43 | port, | 44 | port, |