James Thomas 8d31186be7 Update OpenWhisk documentation for installing provider plugin.
Also, updated IBM Cloud registration instructions
2018-06-01 15:15:28 +01:00

1.2 KiB

Read this on the main serverless docs site

Hello World PHP Example

Make sure serverless is installed. See installation guide.

1. Create a service

serverless create --template openwhisk-php --path myService or sls create --template openwhisk-php --path myService, where 'myService' is a new folder to be created with template service files. Change directories into this new folder.

2. Install Provider Plugin

Run npm install in the service directory.

3. Deploy

serverless deploy or sls deploy. sls is shorthand for the Serverless CLI command

4. Invoke deployed function

serverless invoke --function helloWorld or serverless invoke -f helloWorld

-f is shorthand for --function

In your terminal window you should see the response from Apache OpenWhisk

{
    "payload": "Hello, World!"
}

Congrats you have deployed and ran your Hello World function!