New Node.js 8 runtime for IBM Cloud Functions
This new runtime comes with pre-installed npm packages (bm_db, ibm-cos-sdk, cloudant, watson-developer-cloud) that are useful when integrating serverless functions with IBM Cloud services. For more details on the Node.js 8 environment, check the documentation.
What’s new in Node.js version 8
Using async functions, waiting for a Promise to resolve is as simple as typing
await before it, and proceeding as if the value were synchronously available (without using callbacks).
In this easy to follow example, you can see how to use
await with IBM Db2 Warehouse on Cloud service.
2. Deploy your function by using the CLI, and give it the name “Employees”.
Important: When you create or update an Action, always specify the kind
nodejs:8. If the kind is not explicitly provided, the action uses the default
3. Bind the IBM Cloud service to your function to set the
ssldsn as a default parameter.
For more information about the new service bind for IBM Cloud Functions, see the following blog post.
If you don’t yet have the service created in your Namespace, use the following command to create the service instance.
4. Invoke the Action from the CLI for testing, and retrieve the results:
Get started with IBM Cloud Functions with your Free account.