Dartness class
A server that delivers content, such as web pages, using the HTTP protocol by HttpServer.
Constructors
-
Dartness({int port = 8080, InternetAddress? internetAddress, Iterable<
DartnessController> controllers = const [], Iterable<DartnessMiddleware> middlewares = const [], Iterable<DartnessInterceptor> interceptors = const [], Iterable<DartnessErrorHandler> errorHandlers = const []}) -
Creates a DefaultDartnessServer that listens on the specified
port
andinternetAddress
.
Properties
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
addController(
DartnessController controller) → void -
Add
controller
into Dartness and handles the methods annotated with Bind children to Controller and Bind.method. -
addErrorHandler(
DartnessErrorHandler errorHandler) → void - Adds an interceptor in order to listen between an http request
-
addInterceptor(
DartnessInterceptor interceptor) → void - Adds an interceptor in order to listen between an http request
-
addMiddleware(
DartnessMiddleware middleware) → void - Adds a middleware in order to listen before the http request
-
close(
{bool force = false}) → Future? - Permanently stops the Dartness server from listening for new connections. This closes the Stream of HttpRequests with a done event.
-
create(
{bool logRequest = false}) → Future< void> -
Starts the
_server
. -
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