Last active
July 28, 2018 20:06
-
-
Save ssx/e7616236e8c242a0a11a04f49b379a78 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function main(array $args) : array | |
{ | |
$name = $args['name'] ?? 'stranger'; | |
$greeting = 'Hello '.$name.'!'; | |
return [ | |
'statusCode' => 201, | |
'headers' => [ | |
'X-Header-Test' => 'Something shiny', | |
], | |
'body' => [ | |
'input' => $args, | |
'greeting' => $greeting | |
] | |
]; | |
} | |
function other(array $args) : array | |
{ | |
$name = $args['name'] ?? 'stranger'; | |
$greeting = 'Hello other '.$name.'!'; | |
return [ | |
'statusCode' => 200, | |
'body' => [ | |
'input' => $args, | |
'greeting' => $greeting | |
] | |
]; | |
} | |
# Upload with: | |
# wsk action create greeting greeting.php --web true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment