launch browser

This commit is contained in:
Scott E. Graves 2025-03-03 09:34:13 -06:00
parent 05ef57e3ea
commit c5246048bf

View File

@ -109,6 +109,18 @@ handlers::handlers(mgmt_app_config *config, httplib::Server *server)
#endif // !defined(_WIN32)
std::signal(SIGTERM, quit_handler);
#if defined(_WIN32)
system(
fmt::format(R"(start "http://127.0.0.1:{}/ui")", config_->get_api_port())
.c_str());
#elif defined(__linux__)
system(fmt::format(R"(xdg-open "http://127.0.0.1:{}/ui")",
config_->get_api_port())
.c_str());
#else // error
build fails here
#endif
server_->listen("127.0.0.1", config_->get_api_port());
this_server = nullptr;
}