mount method

  1. @override
void mount(
  1. Handler handler
)
override

Mounts handler as the base handler for this server.

All requests to url or and URLs beneath it will be sent to handler until close is called.

Throws a StateError if there's already a handler mounted.

Implementation

@override
void mount(Handler handler) {
  if (_mounted) {
    throw StateError("Can't mount two handlers for the same server.");
  }
  _mounted = true;

  serveRequests(server, handler);
}