初版网页

This commit is contained in:
2026-08-10 21:05:36 +08:00
parent cfc0849081
commit f50e9f7c1e
19 changed files with 1697 additions and 16 deletions
+29
View File
@@ -0,0 +1,29 @@
#include "Web_Server.h"
#include "Renderive_WebSocket_Controller.h"
#include <drogon/drogon.h>
#include <algorithm>
#include <iostream>
#include <memory>
#include <thread>
namespace renderive::web {
int run_web_server(std::uint16_t port) {
const auto controller = std::make_shared<Renderive_WebSocket_Controller>();
const auto hardware_threads = std::max(2U, std::thread::hardware_concurrency());
std::cout << "Renderive WebSocket backend: ws://127.0.0.1:" << port
<< "/renderive\n"
<< "Open webapp/index.html directly; no HTTP application endpoint is used.\n";
drogon::app()
.registerController(controller)
.addListener("127.0.0.1", port)
.setThreadNum(std::min(8U, hardware_threads))
.setIdleConnectionTimeout(90)
.run();
return 0;
}
} // namespace renderive::web