Server class Null safety

An adapter with a concrete URL.

The most basic definition of "adapter" includes any function that passes incoming requests to a Handler and passes its responses to some external client. However, in practice, most adapters are also servers—that is, they're serving requests that are made to a certain well-known URL.

This interface represents those servers in a general way. It's useful for writing code that needs to know its own URL without tightly coupling that code to a single server implementation.

There are two built-in implementations of this interface. You can create a server backed by dart:io using IOServer, or you can create a server that's backed by a normal Handler using ServerHandler.

Implementations of this interface are responsible for ensuring that the members work as documented.

Implementers

Constructors

Server()

Properties

hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
url Uri
The URL of the server.
read-only

Methods

close() Future<void>
Closes the server and returns a Future that completes when all resources are released.
mount(Handler handler) → void
Mounts handler as the base handler for this server.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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