1#ifndef PLOTLY_DETAILS_HTTP_SERVER_HPP
2#define PLOTLY_DETAILS_HTTP_SERVER_HPP
31 httplib::Server _server;
33 std::thread _serverThread;
42 explicit HttpServer(
const std::filesystem::path &directory);
69 [[nodiscard]]
auto getPort() const noexcept ->
int;
void setWebsocketPortRequestHandler(int wsPort)
Configure the server to respond with a specific WebSocket port.
Definition http_server.cpp:61
auto getPort() const noexcept -> int
Get the port number the server is running on.
Definition http_server.cpp:59
void start()
Start the HTTP server.
Definition http_server.cpp:31
HttpServer(const std::filesystem::path &directory)
Construct a server serving files from a directory.
Definition http_server.cpp:22
HttpServer(HttpServer &&)=delete
HttpServer(const HttpServer &)=delete
void stop()
Stop the HTTP server.
Definition http_server.cpp:49
~HttpServer()
Destructor.
Definition http_server.cpp:29
auto operator=(const HttpServer &) -> HttpServer &=delete
auto operator=(HttpServer &&) -> HttpServer &=delete
Definition browser.cpp:27