Fix loading ports from portmap instead of setting the default one as default
@@ -73,12 +73,14 @@ func NewServerConfiguration(conf *config.CouperFile, log *logrus.Entry) (ServerC
return nil, err
}
- serverConfiguration := ServerConfiguration{
- Port(defaultPort): NewMuxOptions(hostsMap),
- }
+ serverConfiguration := make(ServerConfiguration)
+ if len(validPortMap) == 0 {
+ serverConfiguration[Port(defaultPort)] = NewMuxOptions(hostsMap)
+ } else {
for p := range validPortMap {
serverConfiguration[p] = NewMuxOptions(hostsMap)
}
+ }
api := make(map[*config.Endpoint]http.Handler)
