'Get parameter in totalJS Flow?

I would like to get parameter on my flow, for example, http://localhost:8000/?param1=12.

If i want to recup param1 in my application, how and where can i do it ?



Solution 1:[1]

  • install httproute component
  • edit route options, add your endpoint e.g. /endpoint/ + check respond automatically
  • add code component and join it with HTTP route
  • in the code you can use:
// now can get a value from query arguments
value.query.param1

// Performs next proccessing
send(0, value);

Or you can use httplistener component but this component captures all requests. httplistener has contain same properties like httproute.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Peter Sirka