AppConfig class abstract base

Constructors

AppConfig({required String host, required int port, String? prefix = _defaultPrefix, int workers = 1, int backlog = 0})
const
AppConfig.defaultApp()
const
AppConfig.fromEnv({String hostVariable = 'HOST', String portVariable = 'PORT', String defaultHost = '0.0.0.0', int defaultPort = 8080, String? prefix = _defaultPrefix, int workers = 1, int backlog = 0, Env? env})
Takes host and port from the environment at startup.
AppConfig.secure({required String host, required int port, required SecurityContext securityContext, bool requestClientCertificate = false, String? prefix = _defaultPrefix, int workers = 1, int backlog = 0})
const

Properties

backlog int
Listen backlog passed to HttpServer.bind / HttpServer.bindSecure.
final
compression CompressionSettings
Gzip compression of responses.
no setter
drainDelay Duration
How long readiness reports 503 before the listener stops accepting.
no setter
handleShutdownSignals bool
Whether the server stops itself on SIGTERM / SIGINT.
no setter
hashCode int
The hash code for this object.
no setterinherited
health HealthSettings
Liveness and readiness probes.
no setter
host String
final
port int
final
prefix String?
final
requestClientCertificate bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
securityContext SecurityContext?
final
shutdownTimeout Duration
How long a shutdown waits for in-flight requests before giving up.
no setter
workers int
Number of isolates that accept connections on port.
final

Methods

configureDependencies(covariant DI di) Future<void>
createBroker() Future<MessageBroker?>
The broker @Consumes handlers subscribe to.
initializeDI() DI
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onServerStarted(HttpServer server) → void
onServerStopped() Future<void>
Called once in-flight requests have drained, before the process exits.
runStartup(Future<HttpServer> start()) Future<HttpServer>
Runs the async server startup sequence (bind, DI, routes, listen).
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited