DirectServer class

HTTP server that exposes a REST/WebSocket API for headless usage.

Usage:

final server = DirectServer();
await server.start(ServerConfig(port: 9000, authToken: 'secret'));
// ... server is running ...
await server.stop();

Constructors

DirectServer()

Properties

hashCode int
The hash code for this object.
no setterinherited
onRequest Stream<RequestLog>
Stream of request log entries for monitoring.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status ServerStatus
The current server status.
no setter

Methods

dispose() → void
Releases resources.
getEndpoints() List<ServerEndpoint>
Returns the list of registered API endpoints.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start(ServerConfig config) Future<void>
Starts the server with the given config.
stop() Future<void>
Gracefully shuts down the server.
toString() String
A string representation of this object.
inherited

Operators

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