更新时间:2025-04-24 GMT+08:00

PHP函数模板

以下为PHP函数的示例代码模板:

<?php
/*function initializer($context) {
    $output = 'hello Initializer';
    return $output;
}*/ 
function handler($event, $context) {
    $output = array(
        "statusCode" => 200,
        "headers" => array(
            "Content-Type" => "application/json",
        ),
        "isBase64Encoded" => false,
        "body" => json_encode($event),
    );
    return $output;
}
?>

使用FunctionGraph控制台创建空白PHP事件函数,默认部署上述示例代码。