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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user