start method

Future<void> start()

Start the server

Implementation

Future<void> start() async {
  _server = await shelf_io.serve(pipeline, InternetAddress.anyIPv4, port);
  _server!.idleTimeout = requestTimeout;
  print('Server running at http://localhost:$port');

  // Graceful shutdown on SIGINT and SIGTERM
  _sigintSub = ProcessSignal.sigint.watch().listen((_) => _shutdown());
  if (!Platform.isWindows) {
    _sigtermSub = ProcessSignal.sigterm.watch().listen((_) => _shutdown());
  }
}