It is possible to pass in parameters to an alias which you have defined in your Profound.js config.js
For this, let's take the connect4.js example. In the initialize function, Math.random() is used to decide who will have the first turn.
Instead, let's make it so we can pass the 'turncolor' in as a variable. To do this, we need to add a parameter to the connect4 and initialize function - as well as adding the logic to handle the parameter:
This means we can still call our connect4.js example normally, but we can also pass in a parameter too:
The names of the GET parameters in the URL are irreverent. What is important is the sequence they are passed in and the sequence should always match the order of the calling program's parameters.
For example, let's use this program function:
Valid ways of calling this via an alias are:
- http://localhost:8081/myprogram?username=Profound Logicfirstname.lastname@example.org
- http://localhost:8081/myprogram?p1=Profound Logicemail@example.com
An invalid way might be: