44 {
46
48
49 {
51
55
58 res->send("Hello! I am VHOST atlas.home.vchrist.at.");
59 });
61
64 res->send("Hello! I am VHOST ceres.home.vchrist.at.");
65 });
67
69 res->status(404).
send(
"The requested resource is not found.");
70 });
71
72 legacyApp.listen(8080,
75 switch (state) {
76 case core::socket::State::OK:
77 VLOG(1) << instanceName << " listening on '" << socketAddress.toString() << "'";
78 break;
79 case core::socket::State::DISABLED:
80 VLOG(1) << instanceName << " disabled";
81 break;
82 case core::socket::State::ERROR:
83 LOG(ERROR) << instanceName << " " << socketAddress.toString() << ": " << state.what();
84 break;
85 case core::socket::State::FATAL:
86 LOG(FATAL) << instanceName << " " << socketAddress.toString() << ": " << state.what();
87 break;
88 }
89 });
90 }
91
92 {
94
98
101 res->send("Hello! I am VHOST atlas.home.vchrist.at.");
102 });
104
107 res->send("Hello! I am VHOST ceres.home.vchrist.at.");
108 });
110
112 res->status(404).
send(
"The requested resource is not found.");
113 });
114
115 tlsApp.listen(8088,
118 switch (state) {
119 case core::socket::State::OK:
120 VLOG(1) << instanceName << " listening on '" << socketAddress.toString() << "'";
121 break;
122 case core::socket::State::DISABLED:
123 VLOG(1) << instanceName << " disabled";
124 break;
125 case core::socket::State::ERROR:
126 LOG(ERROR) << instanceName << " " << socketAddress.toString() << ": " << state.what();
127 break;
128 case core::socket::State::FATAL:
129 LOG(FATAL) << instanceName << " " << socketAddress.toString() << ": " << state.what();
130 break;
131 }
132 });
133
134 tlsApp.getConfig().setCert("/home/voc/projects/snodec/snode.c/certs/wildcard.home.vchrist.at_-_snode.c_-_server.pem");
135 tlsApp.getConfig().setCertKey(
136 "/home/voc/projects/snodec/snode.c/certs/Volker_Christian_-_Web_-_snode.c_-_server.key.encrypted.pem");
137 tlsApp.getConfig().setCertKeyPassword("snode.c");
138 }
139
141}
#define APPLICATION(req, res)
Route & use(const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const
Route & get(const Router &router) const
typename Server::SocketAddress SocketAddress
static void init(int argc, char *argv[])
static int start(const utils::Timeval &timeOut={LONG_MAX, 0})
static CLI::Option * addStringOption(const std::string &name, const std::string &description, const std::string &typeName)
static std::string getStringOptionValue(const std::string &name)
static express::Router getRouter()
ssize_t send(int sockfd, const void *buf, std::size_t len, int flags)
class VHost & VHost(const std::string &host)