public WebServerConfig(dynamic config)
 {
     try
     {
         // load the config data.
         Enabled = config.enabled;
         BindInterface = string.IsNullOrEmpty(config.bind) ? "localhost" : config.bind;
         Port = config.port == 0 ? 80 : config.port;
         Template = string.IsNullOrEmpty(config.template) ? "default" : config.template;
         Feed = string.IsNullOrEmpty(config.feed) ? "" : config.feed;
         Backend = new BackendConfig(config.backend);
         Valid = true;
     }
     catch (Exception e)
     {
         Valid = false;
         Log.Logger.ForContext<WebServerConfig>().Error(e, "Error loading web-server configuration");
     }
 }
示例#2
0
 public WebServerConfig(dynamic config)
 {
     try
     {
         // load the config data.
         Enabled       = config.enabled;
         BindInterface = string.IsNullOrEmpty(config.bind) ? "localhost" : config.bind;
         Port          = config.port == 0 ? 80 : config.port;
         Template      = string.IsNullOrEmpty(config.template) ? "default" : config.template;
         Feed          = string.IsNullOrEmpty(config.feed) ? "" : config.feed;
         Backend       = new BackendConfig(config.backend);
         Valid         = true;
     }
     catch (Exception e)
     {
         Valid = false;
         Log.Logger.ForContext <WebServerConfig>().Error(e, "Error loading web-server configuration");
     }
 }