网页升级

This commit is contained in:
2026-08-11 06:21:51 +08:00
parent f50e9f7c1e
commit feb7c72e94
40 changed files with 6490 additions and 98 deletions
+6 -6
View File
@@ -1,12 +1,10 @@
#include "Web_Server.h"
#include <charconv>
#include <cstdint>
#include <filesystem>
#include <iostream>
#include <string_view>
namespace {
std::uint16_t parse_port(int argc, char** argv) {
constexpr std::uint16_t default_port = 8848;
if (argc != 3 || std::string_view(argv[1]) != "--port")
@@ -20,10 +18,12 @@ std::uint16_t parse_port(int argc, char** argv) {
}
return static_cast<std::uint16_t>(value);
}
} // namespace
int main(int argc, char** argv) {
const std::uint16_t port = parse_port(argc, argv);
return port == 0 ? 2 : renderive::web::run_web_server(port);
if (port == 0)
return 2;
std::cout << "http://127.0.0.1:8848" << std::endl;
const std::filesystem::path executable = std::filesystem::absolute(argv[0]);
return renderive::web::run_web_server(port, executable.parent_path());
}