APIServerConfig constructor

APIServerConfig({
  1. bool? development,
  2. String? name,
  3. String? version,
  4. String? address,
  5. int? port,
  6. int? securePort,
  7. Object? documentRoot,
  8. Object? domains,
  9. Object? letsEncryptDirectory,
  10. bool letsEncrypt = false,
  11. bool? letsEncryptProduction,
  12. bool? allowRequestLetsEncryptCertificate,
  13. bool hotReload = false,
  14. int? totalWorkers = 1,
  15. bool cookieless = false,
  16. bool? useSessionID,
  17. String? apiCacheControl,
  18. String? staticFilesCacheControl,
  19. bool? cacheStaticFilesResponses,
  20. int? staticFilesCacheMaxMemorySize,
  21. int? staticFilesCacheMaxContentLength,
  22. APIConfig? apiConfig,
  23. bool? logToConsole,
  24. bool? logQueue,
  25. Duration? serverResponseDelay,
  26. Object? args,
})

Implementation

APIServerConfig({
  bool? development,
  String? name,
  String? version,
  String? address,
  int? port,
  int? securePort,
  Object? documentRoot,
  Object? domains,
  Object? letsEncryptDirectory,
  this.letsEncrypt = false,
  bool? letsEncryptProduction,
  bool? allowRequestLetsEncryptCertificate,
  this.hotReload = false,
  int? totalWorkers = 1,
  this.cookieless = false,
  bool? useSessionID,
  String? apiCacheControl,
  String? staticFilesCacheControl,
  bool? cacheStaticFilesResponses,
  int? staticFilesCacheMaxMemorySize,
  int? staticFilesCacheMaxContentLength,
  this.apiConfig,
  bool? logToConsole,
  bool? logQueue,
  this.serverResponseDelay,
  Object? args,
})  : development = development ?? false,
      name = name != null && name.trim().isNotEmpty ? name : 'Bones_API',
      version = version != null && version.trim().isNotEmpty
          ? version
          : BonesAPI.VERSION,
      address = normalizeAddress(address, apiConfig: apiConfig),
      port = resolvePort(port, apiConfig: apiConfig),
      securePort = resolveSecurePort(securePort,
          apiConfig: apiConfig, letsEncrypt: letsEncrypt),
      domainsRoots = parseDomains(domains,
          apiConfig: apiConfig,
          documentRoot: documentRoot,
          checkDirectoryExistence: true),
      letsEncryptProduction = resolveLetsEncryptProduction(
          letsEncryptProduction,
          apiConfig: apiConfig),
      allowRequestLetsEncryptCertificate =
          resolveAllowRequestLetsEncryptCertificate(
              allowRequestLetsEncryptCertificate,
              apiConfig: apiConfig),
      letsEncryptDirectory = resolveLetsEncryptDirectory(letsEncryptDirectory,
          apiConfig: apiConfig, letsEncrypt: letsEncrypt),
      apiCacheControl =
          normalizeHeaderValue(apiCacheControl, defaultApiCacheControl),
      staticFilesCacheControl = normalizeHeaderValue(
          staticFilesCacheControl, defaultStaticFilesCacheControl),
      cacheStaticFilesResponses = resolveCacheStaticFilesResponses(
          cacheStaticFilesResponses,
          apiConfig: apiConfig),
      staticFilesCacheMaxMemorySize = resolveStaticFilesCacheMaxMemorySize(
          staticFilesCacheMaxMemorySize,
          apiConfig: apiConfig),
      staticFilesCacheMaxContentLength =
          resolveStaticFilesCacheMaxContentLength(
              staticFilesCacheMaxContentLength,
              apiConfig: apiConfig),
      useSessionID = resolveUseSessionID(cookieless, useSessionID),
      totalWorkers = resolveTotalWorkers(totalWorkers, apiConfig: apiConfig),
      logToConsole = resolveLogToConsole(logToConsole, apiConfig: apiConfig),
      logQueue = resolveLogQueue(logQueue, apiConfig: apiConfig),
      args = resolveArgs(args);