网页升级
This commit is contained in:
+6
-6
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user