diff --git a/code/framework/src/http/webserver.cpp b/code/framework/src/http/webserver.cpp index 378518900..b712c2004 100644 --- a/code/framework/src/http/webserver.cpp +++ b/code/framework/src/http/webserver.cpp @@ -73,6 +73,12 @@ namespace Framework::HTTP { } } + void Webserver::RegisterPostRequest(const char* path, const PostCallback& callback) const { + if (strlen(path) > 0 && callback) { + _server->Post(path, callback); + } + } + void Webserver::ServeDirectory(const std::string &dir) { _serveDir = dir; if (!dir.empty()) diff --git a/code/framework/src/http/webserver.h b/code/framework/src/http/webserver.h index 9b9fc365d..64446c54d 100644 --- a/code/framework/src/http/webserver.h +++ b/code/framework/src/http/webserver.h @@ -20,6 +20,7 @@ namespace Framework::HTTP { using RequestCallback = fu2::function; + using PostCallback = fu2::function; class Webserver { public: @@ -29,6 +30,7 @@ namespace Framework::HTTP { bool Shutdown(); void RegisterRequest(const char *, const RequestCallback &) const; + void RegisterPostRequest(const char *, const PostCallback &) const; const std::string &GetServeDirectory() { return _serveDir; diff --git a/code/framework/src/utils/command_listener.h b/code/framework/src/utils/command_listener.h index edf29e076..d21cbf42c 100644 --- a/code/framework/src/utils/command_listener.h +++ b/code/framework/src/utils/command_listener.h @@ -9,6 +9,7 @@ #pragma once #include +#include #include #include #include diff --git a/vendors/nodejs/CMakeLists.txt b/vendors/nodejs/CMakeLists.txt index 03e4eea47..b417093a2 100644 --- a/vendors/nodejs/CMakeLists.txt +++ b/vendors/nodejs/CMakeLists.txt @@ -35,7 +35,7 @@ target_include_directories(NodeJS PUBLIC "include") if (WIN32) target_link_libraries(NodeJS libnode.lib dbghelp.lib winmm.lib shlwapi.lib) else() - target_link_libraries(NodeJS node.108) + target_link_libraries(NodeJS PUBLIC node.108) endif () message(STATUS "NodeJS libraries: ${NODEJS_LIBS}")