network-experiment/bmrshared-web/include/bmrshared/directory_request_handler.hpp

30 lines
960 B
C++

// GNU Lesser General Public License v3.0
// Copyright (c) 2025 Bart Beumer <bart@4beumer.nl>
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License v3.0 as published by
// the Free Software Foundation.
//
#pragma once
#include "request_handler_interface.hpp"
#include <filesystem>
namespace bmrshared::web
{
class directory_request_handler : public request_handler_interface
{
public:
explicit directory_request_handler(const std::filesystem::path& document_root);
~directory_request_handler() override;
void handle_request_http(request_response rs) override;
void handle_request_websocket_upgrade(const address_type& address,
const request_type& req,
boost::asio::ip::tcp::socket socket) override;
private:
std::filesystem::path m_document_root;
};
} // namespace bmrshared::web