Skip to content

Commit

Permalink
F #3951: Add listening host (#912)
Browse files Browse the repository at this point in the history
Co-authored-by: Jorge Lobo <[email protected]>
  • Loading branch information
jloboescalona2 and Jorge Lobo authored Mar 4, 2021
1 parent 40515f9 commit 8883d48
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/fireedge/fireedge-server.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ log: prod
# Enable cors (cross-origin resource sharing)
cors: true

# Fireedge server port
# Fireedge server host
host: '0.0.0.0'

# FireEdge server port
port: 2616

# OpenNebula: use it if you have oned and fireedge on different servers
Expand Down
8 changes: 5 additions & 3 deletions src/fireedge/src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import https from 'https'
import {
defaultAppName,
defaultTypeLog,
defaultHost,
defaultPort,
defaultWebpackMode,
defaultApps
Expand Down Expand Up @@ -56,6 +57,7 @@ let frontPath = 'client'

// settings
const appConfig = getConfig()
const host = appConfig.host || defaultHost
const port = appConfig.port || defaultPort
const userLog = appConfig.log || 'dev'

Expand Down Expand Up @@ -152,12 +154,12 @@ let config = {
message: 'Server no start'
}

appServer.listen(port, '0.0.0.0', err => {
appServer.listen(port, host, err => {
if (!err) {
config = {
color: 'green',
type: port,
message: 'Server listen in port %s'
type: `${host}:${port}`,
message: 'Server listen in %s'
}
}
messageTerminal(config)
Expand Down
1 change: 1 addition & 0 deletions src/fireedge/src/server/utils/constants/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ const defaults = {
defaultMethodUserInfo: 'user.info',
defaultIP: defaultIp,
defaultProtocolHotReload: 'http',
defaultHost: '0.0.0.0',
defaultPort: 2616,
availableLanguages: {
bg_BG: 'Bulgarian (Bulgaria)',
Expand Down

0 comments on commit 8883d48

Please sign in to comment.