diff --git a/config/config.default.js b/config/config.default.js index 8c12274..affbc4d 100644 --- a/config/config.default.js +++ b/config/config.default.js @@ -2,6 +2,8 @@ 'use strict'; const path = require('path'); +const electronConfig = require('../electron/config').get() + /** * @param {Egg.EggAppInfo} appInfo app info */ @@ -25,8 +27,8 @@ module.exports = appInfo => { config.cluster = { listen: { - port: 7068, - hostname: '0.0.0.0', + port: electronConfig.egg.port || 7068, + hostname: electronConfig.egg.hostname || '0.0.0.0', // path: '/var/run/egg.sock', }, }; diff --git a/electron/config.js b/electron/config.js index d6d6205..d4dbbf9 100644 --- a/electron/config.js +++ b/electron/config.js @@ -30,6 +30,7 @@ exports.get = function () { title: 'electron-egg', env: 'prod', port: 7068, + hostname: '0.0.0.0', workers: 1 } }