httpNode endpoint - how to "remove"

The RED.httpNode.get works fine and I can register a new endpoint.

2021-01-18 update:

Questions

  1. How can I remove that endpoint?
  2. Is there anywhere a list what endpoints are already defined?
  3. What happens if an endpoint is define multiple times?

Hi @hklages

unfortunately, the Express library we use doesn't provide a convenient API for removing routes. You can see how the HTTP In node tidies up its routes here: node-red/21-httpin.js at master · node-red/node-red · GitHub

You will see that delves into the internals of Express to do the work via RED.httpNode._router.stack

If an endpoint is defined multiple times, then which was registered first will handle the request. If it doesn't respond to the request, it will fall to the next route that matches the request - and so on, down the stack.

1 Like