Server class final

Declares the runtime-agnostic server contract consumed by osrv.

Constructors

Server({required ServerFetch fetch, ServerHook? onStart, ServerHook? onStop, ServerErrorHook? onError})
Creates a server with a mandatory request handler and optional hooks.
const

Properties

fetch ServerFetch
Handles each request routed into this server instance.
final
hashCode int
The hash code for this object.
no setterinherited
onError ServerErrorHook?
Optionally handles uncaught request exceptions.
final
onStart ServerHook?
Runs once after the runtime has started successfully.
final
onStop ServerHook?
Runs once while the runtime is shutting down.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited