APIServerConfig constructor
APIServerConfig({
- bool? development,
- String? name,
- String? version,
- String? address,
- int? port,
- int? securePort,
- Object? documentRoot,
- Object? domains,
- Object? letsEncryptDirectory,
- bool letsEncrypt = false,
- bool? letsEncryptProduction,
- bool? allowRequestLetsEncryptCertificate,
- bool hotReload = false,
- int? totalWorkers = 1,
- bool cookieless = false,
- bool? useSessionID,
- String? apiCacheControl,
- String? staticFilesCacheControl,
- bool? cacheStaticFilesResponses,
- int? staticFilesCacheMaxMemorySize,
- int? staticFilesCacheMaxContentLength,
- APIConfig? apiConfig,
- bool? logToConsole,
- bool? logQueue,
- Duration? serverResponseDelay,
- 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);