DefaultDartnessServer class

A server that delivers content, such as web pages, using the HTTP protocol by HttpServer.

Implemented types

Constructors

DefaultDartnessServer(int _port, {InternetAddress? internetAddress})
Creates a DefaultDartnessServer that listens on the specified _port and internetAddress.

Properties

controllers Set<Object>
no setter
hashCode int
The hash code for this object.
no setterinherited
isStarted bool
Returns true if the server is listening for connections.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addController(DartnessController controller) → void
Add controller into _controllers and handles the methods annotated with Bind children classes to Controller.path and Bind.path.
override
addErrorHandler(DartnessErrorHandler errorHandler) → void
Adds a error handler in order to listen for errors
override
addInterceptor(DartnessInterceptor interceptor) → void
Adds an interceptor in order to listen before the http request
override
addMiddleware(DartnessMiddleware middleware) → void
Adds a middleware in order to listen between an http request and the applications running on it.
override
getAddress() InternetAddress
Returns the InternetAddress that the server is listening on.
override
getPort() int
Returns the port that the server is listening on.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start() Future<void>
Starts an HttpServer that listens by the specified _internetAddress and _port.
override
stop({bool force = false}) Future<void>
Permanently stops the HttpServer server from listening for new connections. This closes the Stream of HttpRequests with a done event.
override
toString() String
A string representation of this object.
inherited

Operators

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