serve function
Future<ServerHandle>
serve(
- Future<
Response> handler(), { - String host = '127.0.0.1',
- int port = 8080,
- TlsConfig? tls,
- bool h2c = false,
- CorsOptions? cors,
- String? staticDir,
- String? spaRoot,
- bool compression = true,
- Duration requestTimeout = const Duration(seconds: 60),
- int maxBodyBytes = 1024 * 1024,
- Iterable<
DVRouteBodyLimit> routeBodyLimits = const <DVRouteBodyLimit>[],
Serves the handler configuration.
Implementation
Future<ServerHandle> serve(
Future<Response> Function(Request) handler, {
String host = '127.0.0.1',
int port = 8080,
TlsConfig? tls,
bool h2c = false,
CorsOptions? cors,
String? staticDir,
String? spaRoot,
bool compression = true,
Duration requestTimeout = const Duration(seconds: 60),
int maxBodyBytes = 1024 * 1024,
Iterable<DVRouteBodyLimit> routeBodyLimits = const <DVRouteBodyLimit>[],
}) async {
throw StateError(
'Dartvel Shelf server requires the FFI native backend. Build with dart.library.ffi and the ffigen-generated server bindings.',
);
}