The Velo code panel comes equipped with a quick-test environment for debugging your backend code.
Backend code is essential to any Velo site. Since backend code is not visible to site visitors, all sensitive information should be .
One drawback of backend code is that you need to invest effort to trigger the code and test it, such as calling functions from the client side on a test page in your site. This can slow down the development and debugging process.
To save you time and effort, Velo enables quick testing of backend functions directly in the code panel.
For step-by-step instructions on how to test your backend code, see .
To test your backend function in the code panel, write your function in a as usual. Click the Play icon next to the function to open the testing environment.
A new tab opens in the code panel for testing your function. Add sample parameter values and run the function in the test tab. The output appears on the right side of the tab.
- You can only test functions located in .js and .jsw files.
- You can only test functions that are exported.
The output you see in the test tab is the same as the output you would see in the if you previewed your site and triggered the function. Testing backend functions in the code panel has other similarities to testing in Preview mode:
- If you run code that affects a Wix app, the Wix app data is updated. For example, if you're testing code that creates a new Wix Stores product, the product is created when you test the code.
- When testing code that interacts with a database collection not associated with a Wix app, you'll be working with the data in your and not your .
- When testing your code, you are assigned the Admin . That means you are granted all possible .
- If there is a problem with your code, you'll see the same errors you would see in Preview mode.
- You can use to monitor your function output. The is "Preview."