58 {
60
62
63 if (configurator != nullptr) {
64 configurator(webApp.getConfig());
65 }
66
67 webApp.listen([instanceName, reportState](
const SocketAddress& socketAddress,
const core::socket::State& state) {
68 if (reportState != nullptr) {
69 reportState(instanceName, socketAddress, state);
70 } else {
71 switch (state) {
73 VLOG(1) << instanceName << ": listening on '" << socketAddress.toString() << "'";
74 break;
76 VLOG(1) << instanceName << ": disabled";
77 break;
79 VLOG(1) << instanceName <<
": " << socketAddress.toString() <<
": " << state.
what();
80 break;
82 VLOG(1) << instanceName <<
": " << socketAddress.toString() <<
": " << state.
what();
83 break;
84 }
85 }
86 });
87
88 VLOG(1) << "Instance: " << instanceName;
89 for (std::string& route : webApp.getRoutes()) {
90 route.erase(std::remove(route.begin(), route.end(), '$'), route.end());
91
92 VLOG(1) << " " << route;
93 }
94
95 return webApp;
96 }
static constexpr int DISABLED
static constexpr int ERROR
static constexpr int FATAL
typename Server::SocketAddress SocketAddress
Router router(database::mariadb::MariaDBClient &db)