diff --git a/config.json b/config.json index e28d03a94750597368472df20ab897f0f9739a89..d5f7713c05a18e05fb6a1915d09c3b69cdb0af68 100644 --- a/config.json +++ b/config.json @@ -8,7 +8,7 @@ "entrynodes": [ "V8LYtWWcPYYDTTXLeIEFjJEuWlsjDiI0+Pq/Cx9ai6g=@116.202.49.178:14626" ], - "port":14626 + "port": 14626 }, "database": { "directory": "mainnetdb" @@ -16,6 +16,9 @@ "gossip": { "port": 14666 }, + "webapi": { + "bindAddress": "0.0.0.0:8080" + }, "graph": { "webrootPath": "./IOTAtangle/webroot", "socketioPath": "./socket.io-client/dist/socket.io.js", diff --git a/plugins/webapi/parameters.go b/plugins/webapi/parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..e5703ce31f628451739d2b38df4a368a4f39ccc4 --- /dev/null +++ b/plugins/webapi/parameters.go @@ -0,0 +1,13 @@ +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") +} diff --git a/plugins/webapi/plugin.go b/plugins/webapi/plugin.go index c7bd41f334d257aadd74973b31d22e899208ed6f..79365c8727fa71c9c031c3228c5af22e505567c9 100644 --- a/plugins/webapi/plugin.go +++ b/plugins/webapi/plugin.go @@ -4,6 +4,7 @@ import ( "context" "time" + "github.com/iotaledger/goshimmer/packages/parameter" "github.com/iotaledger/goshimmer/packages/shutdown" "github.com/iotaledger/hive.go/daemon" "github.com/iotaledger/hive.go/logger" @@ -30,7 +31,7 @@ func run(plugin *node.Plugin) { log.Info("Starting Web Server ... done") 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") } }()