bool Server::MatchViewOrStatic(const std::string& method,
                               const std::string& url_path, bool* stream) {
  if (Router::MatchView(method, url_path, stream)) {
    return true;
  }

  // Try to match a static file.
  if (method == methods::kGet && !doc_root_.empty()) {
    fs::path sub_path = utility::TranslatePath(url_path);
    //LOG_INFO("Translated URL path: %s", sub_path.u8string().c_str());
    fs::path path = doc_root_ / sub_path;

    fs::error_code ec;
    if (!fs::is_directory(path, ec) && fs::exists(path, ec)) {
      return true;
    }
  }

  return false;
}
bool Server::MatchViewOrStatic(const std::string& method,
                               const std::string& url_path, bool* stream) {
  if (Router::MatchView(method, url_path, stream)) {
    return true;
  }

   
  if (method == methods::kGet && !doc_root_.empty()) {
    fs::path sub_path = utility::TranslatePath(url_path);
     
    fs::path path = doc_root_ / sub_path;

    fs::error_code ec;
    if (!fs::is_directory(path, ec) && fs::exists(path, ec)) {
      return true;
    }
  }

  return false;
}