diff --git a/repertory/repertory/src/ui/handlers.cpp b/repertory/repertory/src/ui/handlers.cpp index 410f3f7e..dc33bb33 100644 --- a/repertory/repertory/src/ui/handlers.cpp +++ b/repertory/repertory/src/ui/handlers.cpp @@ -113,8 +113,6 @@ handlers::handlers(mgmt_app_config *config, httplib::Server *server) handle_put_set_value_by_name(req, res); }); - event_system::instance().start(); - static std::atomic this_server{server_}; static const auto quit_handler = [](int /* sig */) { auto *ptr = this_server.load(); @@ -158,6 +156,8 @@ handlers::handlers(mgmt_app_config *config, httplib::Server *server) return; } + event_system::instance().start(); + server_->listen("127.0.0.1", config_->get_api_port()); this_server = nullptr; }