AppConfig class
Constructors
AppConfig ({required String appKey , int serverPort = 3000 , int ? totalIsolate , List <DoxService > services = const <DoxService>[] , List <DtoSchema <Object > > dtos = const <DtoSchema<Object>>[] , MessageResolver ? validationMessages , List globalMiddleware = const <dynamic>[] , List <Router > routers = const <Router>[] , CORSConfig cors = const CORSConfig() , LoggerConfig logger = const LoggerConfig() , CacheConfig cache = const CacheConfig(defaultStore: 'file', stores: <String, Map<String, dynamic>>{'file' : <String, dynamic>{'driver' : 'file', 'path' : 'storage/cache'}, 'memory' : <String, dynamic>{'driver' : 'memory'}}) , StorageConfig storage = const StorageConfig() , OpenApiConfig openApi = const OpenApiConfig() , SocketIoConfig socketIo = const SocketIoConfig() , dynamic errorHandler (Object ? , StackTrace ) = defaultErrorHandler , ResponseHandlerInterface ? responseHandler , int maxBodySize = 10 * 1024 * 1024 , int maxMultipartSize = 100 * 1024 * 1024 , List <String > trustedProxies = const <String>[] , bool compress = false , ServerBackend server = ServerBackend.native })
Properties
appKey
→ String
final
cache
→ CacheConfig
cache stores for Cache(), see dox_cache
final
compress
→ bool
gzip responses in Dart (HttpServer.autoCompress). Off by default.
It costs CPU on every response. Let the proxy do it when you have one.
final
cors
→ CORSConfig
final
dtos
→ List <DtoSchema <Object > >
Every DTO of the app: dtos from lib/dtos.g.dart.
Dox finds the DTO of a controller parameter and of
req.validate<T>() with it.
final
errorHandler
→ dynamic Function(Object ? , StackTrace )
final
globalMiddleware
→ List
final
hashCode
→ int
The hash code for this object.
no setter inherited
logger
→ LoggerConfig
final
maxBodySize
→ int
Max size in bytes of a JSON or urlencoded body. Bigger bodies get
413 Payload Too Large. Default 10 MB.
final
maxMultipartSize
→ int
Max size in bytes of a multipart/form-data body (file uploads).
Bigger bodies get 413 Payload Too Large. Default 100 MB.
final
openApi
→ OpenApiConfig
/docs, /openapi.json and /openapi.yaml, see dox_openapi
final
responseHandler
→ ResponseHandlerInterface ?
final
routers
→ List <Router >
final
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
server
→ ServerBackend
The HTTP server. Default ServerBackend.native . The env var
DOX_SERVER=dartio wins over this value. DOX_SERVER=native forces
the native server, even for an app with WebSocket routes.
final
serverPort
→ int
final
services
→ List <DoxService >
final
socketIo
→ SocketIoConfig
Socket.IO on the http port, see dox_socketio. Off by default.
final
storage
→ StorageConfig
storage disks for Storage(), see dox_storage
final
totalIsolate
→ int
final
trustedProxies
→ List <String >
IPs or CIDR ranges of reverse proxies (nginx, Caddy, load balancer)
that Dox trusts. Only when the direct client is in this list does Dox
read X-Forwarded-For for req.ip() and X-Forwarded-Proto for
req.scheme(). Use ['*'] to trust any client (only safe when the
app port is not reachable from outside). Empty by default.
final
validationMessages
→ MessageResolver ?
Messages for validation errors, for example in other languages.
Default: the English messages.
final
Methods
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString ()
→ String
A string representation of this object.
inherited