conveyor
conveyor copied to clipboard
Changes to flow endpoints and Node-RED proxy
As of today you can make requests to /flow/{name}/data
and /flow/{name}/config
these requests are then forwarded to Node-RED for handling. This results in a lot of extra nodes in the sources to handle these requests. For the most part a GET /flow/{name}/data
does the same thing on each source: it gets the channel data from ES. However a POST /flow/{name}/data
is used to do special things for both the CSV, push API, and other flows.
I propose that we enhance the proxy logic. For each requests on one of these endpoints we:
- Proxy the request to node red
- If we receive back a 404 from node red then we use logic in the API to handle the request.
- If we receive a good result from node red then we return the response from node red.
In this way we can remove the endpoint flows from each source in most locations, yet leave them in place where needed.