forked from docs/doc-exports
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com> Co-authored-by: Chen, Junjie <chenjunjie@huawei.com> Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
1.3 KiB
1.3 KiB
Do You Have Sample Code for Initializers?
Yes. See the following examples:
- Node.js
exports.initializer = function(context, callback) { callback(null, ''); };
- Python
def my_initializer(context): print("hello world!")
- Java
public void my_initializer(Context context) { RuntimeLogger log = context.getLogger(); log.log(String.format("ak:%s", context.getAccessKey())); }
- PHP
<?php Function my_initializer($context) { echo 'hello world' . PHP_EOL; } ?>
Parent topic: General FAQs