Search code examples
javascripthttpnode-red

Make dynamic hyperlinks in Node-RED


I have a Template/HTML node in an Node-RED project, with hyperlinks like <a href="/result/12345">...</a>.

My question is: how to make a http request node that "dynamically" reads an URL such that, interprets "12345", and makes something? Must I connect a http req node to Template/HTML node?

I'm novice with Node-RED, so some things are new to me on it, though I have some experience with HTML, web-pages constructions, and so on.


Solution

  • You can use express URL parameters in the Node-RED http-in node:

    enter image description here

    You can then access the variable as follows:

    msg.req.param.id;