BuildConfig.fromJson constructor
Creates a build configuration from JSON emitted by spry.config.dart.
Implementation
factory BuildConfig.fromJson(
Map<String, Object?> json, {
required String rootDir,
}) {
return BuildConfig(
rootDir: rootDir,
host: _readString(json, 'host') ?? '0.0.0.0',
port: _readInt(json, 'port') ?? 3000,
target: _readBuildTarget(json, 'target') ?? BuildTarget.vm,
routesDir: _readString(json, 'routesDir') ?? 'routes',
middlewareDir: _readString(json, 'middlewareDir') ?? 'middleware',
publicDir: _readString(json, 'publicDir') ?? 'public',
outputDir: _readString(json, 'outputDir') ?? '.spry',
caseSensitive: _readBool(json, 'caseSensitive') ?? true,
handlerCacheCapacity: _readPositiveInt(json, 'handlerCacheCapacity'),
reload: _readReloadStrategy(json, 'reload') ?? ReloadStrategy.restart,
wranglerConfig: _readNullableString(json, 'wranglerConfig'),
openapi: _readOpenApiConfig(json, 'openapi'),
client: _readClientConfig(json, 'client'),
);
}