Handler _onlyGetRootMiddleware()

in google_cloud/example/example.dart [87:93]


Handler _onlyGetRootMiddleware(Handler handler) => (Request request) async {
      if (request.method == 'GET' && request.url.pathSegments.isEmpty) {
        return await handler(request);
      }

      throw BadRequestException(404, 'Not found');
    };