start method

Future<HttpServer> start()

Starts the server and binds it to the specified IP and port.

If config.noStop is true, the server will run within a guarded zone to handle errors. Otherwise, it runs normally.

Returns a Future containing the HttpServer instance.

Implementation

Future<HttpServer> start() {
  if (config.noStop) {
    return runZonedGuarded(() => _run(), (error, stack) {
      Console.e({
        'error': error,
        'stack': stack.toString().split("#"),
      });
    })!;
  } else {
    return _run();
  }
}