mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-08-25 00:15:06 +03:00
Minor refactoring
This commit is contained in:
parent
97a84cd1f1
commit
71b38c4d0b
1 changed files with 9 additions and 8 deletions
|
@ -201,7 +201,7 @@ func run(args yggArgs, ctx context.Context) {
|
||||||
// that neither -autoconf, -useconf or -useconffile were set above. Stop
|
// that neither -autoconf, -useconf or -useconffile were set above. Stop
|
||||||
// if we don't.
|
// if we don't.
|
||||||
if cfg == nil {
|
if cfg == nil {
|
||||||
return
|
panic("broken configuration")
|
||||||
}
|
}
|
||||||
n := &node{}
|
n := &node{}
|
||||||
// Have we been asked for the node address yet? If so, print it and then stop.
|
// Have we been asked for the node address yet? If so, print it and then stop.
|
||||||
|
@ -230,13 +230,6 @@ func run(args yggArgs, ctx context.Context) {
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//override httpaddress and wwwroot parameters in cfg
|
|
||||||
if len(cfg.HttpAddress) == 0 {
|
|
||||||
cfg.HttpAddress = args.httpaddress
|
|
||||||
}
|
|
||||||
if len(cfg.WwwRoot) == 0 {
|
|
||||||
cfg.WwwRoot = args.wwwroot
|
|
||||||
}
|
|
||||||
|
|
||||||
// Setup the RiV-mesh node itself.
|
// Setup the RiV-mesh node itself.
|
||||||
{
|
{
|
||||||
|
@ -274,6 +267,14 @@ func run(args yggArgs, ctx context.Context) {
|
||||||
|
|
||||||
// Setup the REST socket.
|
// Setup the REST socket.
|
||||||
{
|
{
|
||||||
|
//override httpaddress and wwwroot parameters in cfg
|
||||||
|
if len(cfg.HttpAddress) == 0 {
|
||||||
|
cfg.HttpAddress = args.httpaddress
|
||||||
|
}
|
||||||
|
if len(cfg.WwwRoot) == 0 {
|
||||||
|
cfg.WwwRoot = args.wwwroot
|
||||||
|
}
|
||||||
|
|
||||||
if n.rest_server, err = restapi.NewRestServer(restapi.RestServerCfg{
|
if n.rest_server, err = restapi.NewRestServer(restapi.RestServerCfg{
|
||||||
Core: n.core,
|
Core: n.core,
|
||||||
Log: logger,
|
Log: logger,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue