AppConfig constructor
AppConfig({
- required String appKey,
- int serverPort = 3000,
- int? totalIsolate,
- List<
DoxService> services = const <DoxService>[], - List<
DtoSchema< dtos = const <DtoSchema<Object>>[],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() = 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,
Implementation
AppConfig({
required this.appKey,
this.serverPort = 3000,
/// isolates (threads) that serve http. Default: one per CPU core.
int? totalIsolate,
this.services = const <DoxService>[],
this.dtos = const <DtoSchema<Object>>[],
this.validationMessages,
this.globalMiddleware = const <dynamic>[],
this.routers = const <Router>[],
this.cors = const CORSConfig(),
this.logger = const LoggerConfig(),
this.cache = const CacheConfig(
defaultStore: 'file',
stores: <String, Map<String, dynamic>>{
'file': <String, dynamic>{'driver': 'file', 'path': 'storage/cache'},
'memory': <String, dynamic>{'driver': 'memory'},
},
),
this.storage = const StorageConfig(),
this.openApi = const OpenApiConfig(),
this.socketIo = const SocketIoConfig(),
this.errorHandler = defaultErrorHandler,
this.responseHandler,
this.maxBodySize = 10 * 1024 * 1024,
this.maxMultipartSize = 100 * 1024 * 1024,
this.trustedProxies = const <String>[],
this.compress = false,
this.server = ServerBackend.native,
}) : totalIsolate = totalIsolate ?? Platform.numberOfProcessors;