HTML to activate GPIO

Hello together,

for the first, excuse me for my bad english.
for the second, I doesn't know much about programming.

what i want to do is:

html to activate a GPIO for maybe 15 minutes

so when I write "http://192.168.X.X/test/GPIO2" in my browser, i want to activate the GPIO2
when I write "http://192.168.X.X/test/GPIO3" in my browser, i want to activate the GPIO3

I hope you can help me.
And again, excuse me for my bad english, I am german.

If you are using node-red on Raspberry PI use the http request node ( and use the raspberrypi nodes

Okay but i don`t know, how i can do it.

When i write "" i receive it.
But how can i go on with this information?
i mean my GPIO needs a 0 or >1 to switch.
and in the funktion how can i say when GPIO1 then Out1 and when GPIO2 then Out2

Take a look at the switch node and the change node

Try using the switch node and get the data from msg.req.test. Send the payload do desired output

how can i send it to the payload?

on a function node
var gpio = msg.req.test
msg.payload = {"gpio": gpio}

i tryed it but it doesn't worked.

my flow is like this:

  1. http node with "Method GET" an "URL /test"
  2. funktion node with:
    "var gpio = msg.req.test;"
    "msg.payload = {"gpio":gpio};"
  3. switch node, here i don't know what to do!!!
  4. GPIO node

my URL is ""
can you say me what i have to do?

what im looking for ist to switch on GPIO2 when the URL ist test=GPIO2, an to switch on GPIO3 when the URL ist test=GPIO3.

Please export your flow
Then read the following post How to share code or flow json and follow the instructions to post your flow here.