Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:MafiaHub/Framework into improvem…
Browse files Browse the repository at this point in the history
…ent/scripting-engine-revamp
  • Loading branch information
Segfaultd committed Aug 25, 2024
2 parents 7664be6 + 146e967 commit f04a4b5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions code/framework/src/http/webserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 2 additions & 0 deletions code/framework/src/http/webserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

namespace Framework::HTTP {
using RequestCallback = fu2::function<void(const httplib::Request &, httplib::Response &) const>;
using PostCallback = fu2::function<void(const httplib::Request &, httplib::Response &, const httplib::ContentReader &) const>;

class Webserver {
public:
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions code/framework/src/utils/command_listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#pragma once

#include <function2.hpp>
#include <atomic>
#include <memory>
#include <mutex>
#include <queue>
Expand Down
2 changes: 1 addition & 1 deletion vendors/nodejs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit f04a4b5

Please sign in to comment.