Skip to content
Snippets Groups Projects
Commit d08572be authored by Luca Moser's avatar Luca Moser
Browse files

adds bind address parameter for the web api

parent f1cb9270
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"entrynodes": [ "entrynodes": [
"V8LYtWWcPYYDTTXLeIEFjJEuWlsjDiI0+Pq/Cx9ai6g=@116.202.49.178:14626" "V8LYtWWcPYYDTTXLeIEFjJEuWlsjDiI0+Pq/Cx9ai6g=@116.202.49.178:14626"
], ],
"port":14626 "port": 14626
}, },
"database": { "database": {
"directory": "mainnetdb" "directory": "mainnetdb"
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
"gossip": { "gossip": {
"port": 14666 "port": 14666
}, },
"webapi": {
"bindAddress": "0.0.0.0:8080"
},
"graph": { "graph": {
"webrootPath": "./IOTAtangle/webroot", "webrootPath": "./IOTAtangle/webroot",
"socketioPath": "./socket.io-client/dist/socket.io.js", "socketioPath": "./socket.io-client/dist/socket.io.js",
......
package webapi
import (
flag "github.com/spf13/pflag"
)
const (
BIND_ADDRESS = "webapi.bindAddress"
)
func init() {
flag.String(BIND_ADDRESS, "0.0.0.0:8080", "the bind address for the web API")
}
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"context" "context"
"time" "time"
"github.com/iotaledger/goshimmer/packages/parameter"
"github.com/iotaledger/goshimmer/packages/shutdown" "github.com/iotaledger/goshimmer/packages/shutdown"
"github.com/iotaledger/hive.go/daemon" "github.com/iotaledger/hive.go/daemon"
"github.com/iotaledger/hive.go/logger" "github.com/iotaledger/hive.go/logger"
...@@ -30,7 +31,7 @@ func run(plugin *node.Plugin) { ...@@ -30,7 +31,7 @@ func run(plugin *node.Plugin) {
log.Info("Starting Web Server ... done") log.Info("Starting Web Server ... done")
go func() { go func() {
if err := Server.Start(":8080"); err != nil { if err := Server.Start(parameter.NodeConfig.GetString(BIND_ADDRESS)); err != nil {
log.Info("Stopping Web Server ... done") log.Info("Stopping Web Server ... done")
} }
}() }()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment