Files
uWebSockets/examples/HelloWorld.cpp
T
2018-12-30 21:27:42 +01:00

18 lines
423 B
C++

#include "App.h"
int main() {
/* Overly simple hello world app */
uWS::App().get("/*", [](auto *res, auto *req) {
res->end("Hello world!");
}).listen(3000, [](auto *token) {
if (token) {
std::cout << "Listening on port " << 3000 << std::endl;
}
}).run();
std::cout << "Failed to listen on port 3000" << std::endl;
/* This is needed to properly clear everything */
uWS::destroy();
}