fix: engine REST API - handle GET/DELETE requests immediately, use user-provided node IDs

- Use lws_http_get_uri_and_method() for proper HTTP method detection
  (GET, POST, PUT, DELETE all supported)
- Handle GET/DELETE in LWS_CALLBACK_HTTP without waiting for body
- Support user-provided node IDs via config.id field
- Fixes all REST API endpoints hanging on GET requests
This commit is contained in:
Johanness
2026-05-26 21:08:06 +03:00
parent 37f02f01d9
commit 1d6f93679f
2 changed files with 152 additions and 122 deletions
+6 -1
View File
@@ -7,7 +7,12 @@
namespace dmf_engine {
NodeId Graph::add_node(const std::string& type, const nlohmann::json& config) {
auto id = type + "_" + std::to_string(next_node_num_++);
std::string id;
if (config.contains("id") && config["id"].is_string()) {
id = config["id"].get<std::string>();
} else {
id = type + "_" + std::to_string(next_node_num_++);
}
GraphNode node;
node.id = id;
node.type = type;