Wrap up messageHandler, send(message)

This commit is contained in:
Alex Hultman
2018-10-30 03:01:19 +01:00
parent 292476366c
commit f2e2b7107a
5 changed files with 45 additions and 9 deletions
+2
View File
@@ -11,6 +11,8 @@ int main(int argc, char **argv) {
res->end("Hello HTTP!");
}).ws("/*", [](auto *ws, auto *req) {
std::cout << "WebSocket conntected to URL: " << req->getUrl() << std::endl;
}, [](auto *ws, std::string_view message) {
ws->send(message);
}).listen(3000, [](auto *token) {
if (token) {
std::cout << "Listening on port " << 3000 << std::endl;