2. Function Stack
The Function Stack is the internal workings of the API.
The Function Stack is a "stack" of Functions that get executed in a linear fashion. They determine how an endpoint gets processed. The Function Stack is where you will build your business logic. You can add a variety of functions and get as complex as needed. You can watch the Functions video where we touch upon them.
There are a series of functions you have access to broken up into these categories:
To add a new function to the Function Stack, click on the "+" button in the top right-hand corner of the Function Stack.
After hitting the "+" button the window below opens up. There are a variety of options to choose from. Within each option, there are a variety of Functions you can add depending on what business logic you'd like to introduce.
You can move or re-order function easily by clicking the drag handler to the left of the function
Commenting out a Function can be a handy feature to utilize, especially when building complex business logic in the Function Stack. Commenting out the Function means that the Function will essentially be hidden and ignored when running the Stack. This is more advantageous than deleting the Function because the Function is saved and you don't have to start over from scratch.
To hide or comment out a Function, hover over it. Once it's hovered over, an icon of eye will appear. Click on that icon to comment out the Function. The icon will update to be slashed through and the Function will be shaded dark, indicating that it will not be executed.
In this example, Function 3 is being hovered over revealing the icon that allows you to hide it. Function 4 is commented out, notice the dark shade and the slash through the icon.