onHTTPRequest method

Future<void> onHTTPRequest(
  1. HttpRequest request
)

Implementation

Future<void> onHTTPRequest(HttpRequest request) async {
  switch (request.requestedUri.path) {
    case '/json/version':
      onRequestVersion(request);
      break;

    case '/json':
    case '/json/list':
      onRequestList(request);
      break;

    case '/json/new':
      onRequestNew(request);
      break;

    case '/json/close':
      onRequestClose(request);
      break;

    case '/json/protocol':
      onRequestProtocol(request);
      break;

    default:
      onRequestFallback(request);
      break;
  }
  await request.response.close();
}