After writing a function, you must debug the function to verify the correctness of code. Actually,
when a Message Service (MNS) topic receives a message, the function is automatically
triggered. This topic describes how to debug a function by simulating a trigger event
in the Function Compute console.
Procedure
- Log on to the Function Compute console.
- In the top navigation bar, select a region.
- In the left-side navigation pane, click Service/Function.
- Find the required function in the required service and click the name of the function.
- On the Code tab, click Event.
- Write an event in the code editor based on the corresponding event format. For more
information, see Event format. . Then click OK.
- On the Code tab, click Invoke.
Result
On the Code tab, a prompt appears that shows successful function invocation.