launch browser
This commit is contained in:
parent
05ef57e3ea
commit
c5246048bf
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user