defineSpryConfig function
void
defineSpryConfig({
- String? host,
- int? port,
- BuildTarget? target,
- String? routesDir,
- String? middlewareDir,
- String? publicDir,
- String? outputDir,
- bool? caseSensitive,
- int? handlerCacheCapacity,
- ReloadStrategy? reload,
- String? wranglerConfig,
- OpenAPIConfig? openapi,
- ClientConfig? client,
Emits Spry build configuration as JSON for spry.config.dart.
Implementation
void defineSpryConfig({
/// Overrides the host used by `spry serve`.
String? host,
/// Overrides the port used by `spry serve`.
int? port,
/// Selects the target runtime.
BuildTarget? target,
/// Overrides the routes directory.
String? routesDir,
/// Overrides the middleware directory.
String? middlewareDir,
/// Overrides the public asset directory.
String? publicDir,
/// Overrides the generated output directory.
String? outputDir,
/// Controls whether generated routing is case-sensitive.
bool? caseSensitive,
/// Sets the LRU cache capacity used for generated handler lookups.
int? handlerCacheCapacity,
/// Overrides the reload strategy used by `spry serve`.
ReloadStrategy? reload,
/// Overrides the Wrangler config path for Cloudflare targets.
String? wranglerConfig,
/// Enables OpenAPI document generation.
OpenAPIConfig? openapi,
/// Enables Spry client generation.
ClientConfig? client,
}) {
final config = <String, dynamic>{
'host': ?host,
'port': ?port,
'target': ?target?.name,
'routesDir': ?routesDir,
'middlewareDir': ?middlewareDir,
'publicDir': ?publicDir,
'outputDir': ?outputDir,
'caseSensitive': ?caseSensitive,
'handlerCacheCapacity': ?handlerCacheCapacity,
'reload': ?reload?.name,
'wranglerConfig': ?wranglerConfig,
'openapi': ?openapi,
'client': ?client,
};
stdout.writeln(json.encode(config));
}