App<T extends Context> class

Dia application class The web server listens to the http / https port and applies the middleware to the received requests

Middleware in App must be in the same Context as App

Constructors

App([T createContext(HttpRequest request)?])

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
Close HTTP/HTTPS listener
listen(dynamic address, int port, {SecurityContext? securityContext, int backlog = 0, bool v6Only = false, bool shared = false}) Future<void>
Call this method to listen http/https requests on the specified address and port
listenOn(ServerSocket serverSocket) Future<void>
Call this method to listen http/https requests an existing ServerSocket. When the HttpServer is closed, the HttpServer will just detach itself, closing current connections but not closing serverSocket.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
use(Middleware<T> middleware) → void
Add Middleware to App Middleware must be in the same Context as App

Operators

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