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,
  16. bool? useSessionID,
  17. String? apiCacheControl,
  18. String? staticFilesCacheControl,
  19. String? longLivedStaticFilesCacheControl,
  20. Object? longLivedStaticFilesCached,
  21. bool? cacheStaticFilesResponses,
  22. int? staticFilesCacheMaxMemorySize,
  23. int? staticFilesCacheMaxContentLength,
  24. int? maxPayloadLength,
  25. bool? decompressPayload,
  26. APIConfig? apiConfig,
  27. bool? logToConsole,
  28. bool? logQueue,
  29. Duration? serverResponseDelay,
  30. 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,
  bool? cookieless,
  bool? useSessionID,
  String? apiCacheControl,
  String? staticFilesCacheControl,
  String? longLivedStaticFilesCacheControl,
  Object? longLivedStaticFilesCached,
  bool? cacheStaticFilesResponses,
  int? staticFilesCacheMaxMemorySize,
  int? staticFilesCacheMaxContentLength,
  int? maxPayloadLength,
  bool? decompressPayload,
  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,
       apiConfig,
       'cache',
       'api',
       'cache_control',
     ),
     staticFilesCacheControl = normalizeHeaderValue(
       staticFilesCacheControl,
       defaultStaticFilesCacheControl,
       apiConfig,
       'cache',
       'static_files',
       'cache_control',
     ),
     longLivedStaticFilesCacheControl = normalizeHeaderValue(
       longLivedStaticFilesCacheControl,
       defaultLongLivedStaticFilesCacheControl,
       apiConfig,
       'cache',
       'long_lived_static_files',
       'cache_control',
     ),
     longLivedStaticFilesCached = resolveLongLivedStaticFiles(
       longLivedStaticFilesCached,
       def: defaultLongLivedStaticFilesCached,
       apiConfig: apiConfig,
     ),
     cacheStaticFilesResponses = resolveCacheStaticFilesResponses(
       cacheStaticFilesResponses,
       apiConfig: apiConfig,
     ),
     staticFilesCacheMaxMemorySize = resolveStaticFilesCacheMaxMemorySize(
       staticFilesCacheMaxMemorySize,
       apiConfig: apiConfig,
     ),
     staticFilesCacheMaxContentLength =
         resolveStaticFilesCacheMaxContentLength(
           staticFilesCacheMaxContentLength,
           apiConfig: apiConfig,
         ),
     cookieless = resolveCookieless(cookieless, apiConfig: apiConfig),
     useSessionID = resolveUseSessionID(
       cookieless,
       useSessionID,
       apiConfig: apiConfig,
     ),
     totalWorkers = resolveTotalWorkers(totalWorkers, apiConfig: apiConfig),
     maxPayloadLength = resolveMaxPayloadLength(
       maxPayloadLength,
       apiConfig: apiConfig,
     ),
     decompressPayload = resolveDecompressPayload(
       decompressPayload,
       apiConfig: apiConfig,
     ),
     logToConsole = resolveLogToConsole(logToConsole, apiConfig: apiConfig),
     logQueue = resolveLogQueue(logQueue, apiConfig: apiConfig),
     args = resolveArgs(args);