aboutsummaryrefslogtreecommitdiff
path: root/zenhttp/httpuws.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenhttp/httpuws.cpp')
-rw-r--r--zenhttp/httpuws.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/zenhttp/httpuws.cpp b/zenhttp/httpuws.cpp
index e062e7747..2a6950532 100644
--- a/zenhttp/httpuws.cpp
+++ b/zenhttp/httpuws.cpp
@@ -12,6 +12,7 @@
#if ZEN_PLATFORM_WINDOWS
# pragma comment(lib, "Iphlpapi.lib")
+# pragma comment(lib, "userenv.lib")
#endif
namespace zen {
@@ -43,26 +44,21 @@ HttpUwsServer::Run(bool IsInteractive)
if (TestMode == false)
{
- zen::logging::ConsoleLog().info("Zen Server running (null HTTP). Press ESC or Q to quit");
+ zen::logging::ConsoleLog().info("Zen Server running (uWS HTTP). Press ESC or Q to quit");
}
::uWS::App()
- .get("/*",
+ .any("/*",
[](uWS::HttpResponse<false>* res, uWS::HttpRequest* req) {
- res->end("Hello world!");
+ res->onData([=](std::string_view Data, bool fin) {
+ ZEN_UNUSED(Data);
+ if (fin)
+ res->end("Hello world!");
+ });
+
+ res->onAborted([&] {});
ZEN_UNUSED(req);
})
- .post("/*",
- [](uWS::HttpResponse<false>* res, uWS::HttpRequest* req) {
- res->onData([&](std::string_view Data, bool fin) {
- ZEN_UNUSED(Data);
- if (fin)
- res->end("Hello world!");
- });
-
- res->onAborted([&] {});
- ZEN_UNUSED(req);
- })
.listen(m_BasePort, [](auto* listen_socket) { ZEN_UNUSED(listen_socket); })
.run();