{ "moduleId": "test", "id": "http_to_ws", "type": "HTTP", "imports": { "a816bac0-336e-4f5c-be43-db999b3e08da": { "type": "cloud", "id": "a816bac0-336e-4f5c-be43-db999b3e08da", "versionId": "a816bac0-336e-4f5c-be43-db999b3e08da" }, "77236997-0f20-4141-a21c-7f0e88191999": { "type": "cloud", "id": "77236997-0f20-4141-a21c-7f0e88191999", "versionId": "77236997-0f20-4141-a21c-7f0e88191999" }, "c2dfa57f-e73e-452a-8707-db7a451965ce": { "type": "cloud", "id": "c2dfa57f-e73e-452a-8707-db7a451965ce", "versionId": "c2dfa57f-e73e-452a-8707-db7a451965ce" } }, "handlers": { "onStart": "a5CL6vND6LqD4XOIaMPCO" }, "instructions": [ { "type": "defineFunction", "name": "Handle HTTP request", "description": "Handles HTTP request.", "exported": false, "parameters": [ { "type": "tel", "name": "request", "description": "The HTTP request object", "optional": false } ], "id": "l1Ycc5Sh9LD6LLt32flR5", "body": [ { "type": "call", "callee": "import/a816bac0-336e-4f5c-be43-db999b3e08da/read", "parameters": [ { "type": "tel", "name": "key", "expression": "\"test\"" }, { "type": "tel", "name": "saveAs", "expression": "actorId" } ], "id": "uf7YBto6VkVpubfT98Wz0" }, { "type": "if", "condition": "actorId != null", "id": "awtgeZ2eB2gnAHqhxM-DU", "then": [ { "type": "call", "callee": "import/77236997-0f20-4141-a21c-7f0e88191999/send_command", "parameters": [ { "type": "tel", "name": "id", "expression": "actorId" }, { "type": "tel", "name": "message", "expression": "\"message from http endpoint\"" } ], "id": "ALRP2F7v1dbOljRGy08U6" } ], "else": [] }, { "type": "call", "callee": "import/c2dfa57f-e73e-452a-8707-db7a451965ce/respond_with", "parameters": [ { "type": "tel", "name": "body", "expression": "\"OK\"" } ], "id": "j8mHooE0TJvrQPT3Ngyqd" } ] }, { "type": "defineFunction", "name": "On start", "description": "Initializes this module.", "exported": false, "parameters": [], "annotations": [], "id": "a5CL6vND6LqD4XOIaMPCO", "body": [ { "type": "call", "callee": "import/c2dfa57f-e73e-452a-8707-db7a451965ce/setup_route", "parameters": [ { "type": "tel", "name": "method", "expression": "\"get\"" }, { "type": "functionRef", "name": "onHttpRequest", "id": "l1Ycc5Sh9LD6LLt32flR5" }, { "type": "tel", "name": "path", "expression": "\"/http-to-ws\"" } ], "id": "ObDqDqaFfGHCZA0-idtFI" } ] } ] }