APIServerConfig class
API Server Config.
- Implementers
Constructors
- 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, bool? useSessionID, String? apiCacheControl, String? staticFilesCacheControl, String? longLivedStaticFilesCacheControl, Object? longLivedStaticFilesCached, bool? cacheStaticFilesResponses, int? staticFilesCacheMaxMemorySize, int? staticFilesCacheMaxContentLength, int? maxPayloadLength, bool? decompressPayload, APIConfig? apiConfig, bool? logToConsole, bool? logQueue, Duration? serverResponseDelay, Object? args})
- 
          APIServerConfig.fromArgs(List<String> args)
- 
          
            factory
- 
          APIServerConfig.fromJson(Map<String, dynamic> json)
- 
          
            factory
Properties
- address → String
- 
  The bind address of this server.
  final
- allowRequestLetsEncryptCertificate → bool
- 
  If trueallows the request of Let's Encrypt certificates.final
- apiCacheControl → String
- 
  The cache-controlheader for API responses.final
- apiConfig → APIConfig?
- 
  The APIConfig of the APIRoot.
  final
- args → ArgsSimple
- 
  All the parsed arguments, using ArgsSimple.final
- cacheStaticFilesResponses → bool
- 
  If truewill cache static files. Default: truefinal
- 
  If truewill remove anySet-CookieorCookieheader.final
- decompressPayload → bool
- 
  Whether to decompress the request payload if it is compressed using
a supported Content-Encoding(e.g., gzip or deflate).final
- development → bool
- 
  
  final
- 
  domains
  → List<String> 
- 
  Returns a list of domains at domainsRoots keys (non RegExp entries).
  no setter
- 
  domainsRoots
  → Map<Pattern, Directory> 
- 
  The domains root directories.
  final
- hashCode → int
- 
  The hash code for this object.
  no setterinherited
- hotReload → bool
- 
  If trueenables Hot Reload (APIHotReload.enable).final
- letsEncrypt → bool
- 
  If trueenabled Let's Encrypt.final
- letsEncryptDirectory → Directory?
- 
  The Let's Encrypt certificates Directory.
  final
- letsEncryptProduction → bool
- 
  If trueruns Let's Encrypt in production mode.final
- logQueue ↔ bool
- 
  If falsedisables log flush queue.latefinal
- logToConsole ↔ bool
- 
  If truelog messages to stdout (console).latefinal
- longLivedStaticFilesCacheControl → String
- 
  The cache-controlfor long-lived static files. See longLivedStaticFilesCached.final
- 
  longLivedStaticFilesCached
  → List<Pattern> 
- 
  Patterns of files using longLivedStaticFilesCacheControl.
See staticFilesCacheControl.
  final
- maxPayloadLength → int?
- 
  The maximum allowed request payload size in bytes.
  final
- name → String
- 
  The name of this server.
  final
- port → int
- 
  The listen port of this server (HTTP).
  final
- runtimeType → Type
- 
  A representation of the runtime type of the object.
  no setterinherited
- securePort → int
- 
  The listen secure port of this server (HTTPS).
  final
- serverResponseDelay → Duration?
- 
  A forced delay in each server response.
Only active if development is true.final
- staticFilesCacheControl → String
- 
  The cache-controlheader for static files.final
- staticFilesCacheMaxContentLength → int
- 
  The maximum Content-Length(in bytes) allowed for a cachedResponse. Default: 10Mfinal
- staticFilesCacheMaxMemorySize → int
- 
  The maximum memory size (in bytes) for storing all cached Responses. Default: 50Mfinal
- totalWorkers → int
- 
  The number of APIServerWorker instances to spawn.
  final
- useSessionID → bool
- 
  If truethe server will use/generate aSESSIONIDfor each request. Iffalsewill ignore anySESSIONIDcookie (useful to comply with cookieless servers).final
- version → String
- 
  The version of this server.
  final
Methods
- 
  noSuchMethod(Invocation invocation) → dynamic 
- 
  Invoked when a nonexistent method or property is accessed.
  inherited
- 
  toJson() → Map< String, dynamic> 
- 
  toString() → String 
- 
  A string representation of this object.
  inherited
Operators
- 
  operator ==(Object other) → bool 
- 
  The equality operator.
  inherited
Static Methods
- 
  normalizeAddress(String? address, {APIConfig? apiConfig}) → String 
- 
  normalizeHeaderValue(String? header, String def, [APIConfig? apiConfig, String? k0, String? k1, String? k2, String? k3]) → String 
- 
  parseDomainDirectory(Object? dirPath, {bool checkDirectoryExistence = false}) → Directory? 
- Parses a domain Directory.
- 
  parseDomainEntry(Object? o, {bool checkDirectoryExistence = false}) → MapEntry< Pattern, Directory?> ?
- Parses a domain entry as MapEntry.
- 
  parseDomainPattern(Pattern domainPatter) → Pattern 
- Parses a domain pattern.
- 
  parseDomains(Object? o, {APIConfig? apiConfig, Object? documentRoot, bool checkDirectoryExistence = false}) → Map< Pattern, Directory> 
- Parses a set of domains to serve static files.
- 
  resolveAllowRequestLetsEncryptCertificate(bool? allowRequestLetsEncryptCertificate, {APIConfig? apiConfig}) → bool 
- 
  resolveArgs(Object? args) → ArgsSimple 
- 
  resolveCacheStaticFilesResponses(bool? cache, {APIConfig? apiConfig}) → bool 
- 
  resolveCookieless(bool? cookieless, {APIConfig? apiConfig}) → bool 
- 
  resolveDecompressPayload(bool? decompressPayload, {APIConfig? apiConfig}) → bool 
- 
  resolveDomainsRoots(List domains, [Directory? rootDir]) → Map< String, Directory> 
- 
  resolveLetsEncryptDirectory(Object? directory, {APIConfig? apiConfig, bool letsEncrypt = false}) → Directory? 
- 
  resolveLetsEncryptProduction(bool? letsEncryptProduction, {APIConfig? apiConfig}) → bool 
- 
  resolveLogQueue(bool? logQueue, {APIConfig? apiConfig}) → bool 
- 
  resolveLogToConsole(bool? logToConsole, {APIConfig? apiConfig}) → bool 
- 
  resolveLongLivedStaticFiles(Object? patterns, {List< Pattern> ? def, APIConfig? apiConfig}) → List<Pattern> 
- 
  resolveMaxPayloadLength(int? maxPayloadLength, {APIConfig? apiConfig}) → int? 
- 
  resolvePort(int? port, {APIConfig? apiConfig}) → int 
- 
  resolveSecurePort(int? securePort, {APIConfig? apiConfig, bool? letsEncrypt}) → int 
- 
  resolveStaticFilesCacheMaxContentLength(int? max, {APIConfig? apiConfig}) → int 
- 
  resolveStaticFilesCacheMaxMemorySize(int? max, {APIConfig? apiConfig}) → int 
- 
  resolveTotalWorkers(int? totalWorkers, {APIConfig? apiConfig}) → int 
- 
  resolveUseSessionID(bool? cookieless, bool? useSessionID, {APIConfig? apiConfig}) → bool 
Constants
- defaultApiCacheControl → const String
- The default value for apiCacheControl.
- defaultLongLivedStaticFilesCacheControl → const String
- The default value for longLivedStaticFilesCacheControl:
- 
    defaultLongLivedStaticFilesCached
  → const List<Pattern> 
- Default list of patterns for files that should use defaultLongLivedStaticFilesCacheControl.
- defaultStaticFilesCacheControl → const String
- The default value for staticFilesCacheControl: