Updated on 2023-04-27 GMT+08:00
Do You Have Sample Code for Initializers?
Yes. See the following examples:
- Node.js (Initializer introduction)
exports.initializer = function(context, callback) { callback(null, ''); };
- Python (Initializer introduction)
def my_initializer(context): print("hello world!")
- Java (Initializer introduction)
public void my_initializer(Context context) { RuntimeLogger log = context.getLogger(); log.log(String.format("ak:%s", context.getAccessKey())); }
- PHP (Initializer introduction)
<?php Function my_initializer($context) { echo 'hello world' . PHP_EOL; } ?>
Parent topic: General FAQs
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot