(many languages supported) • deploy it to the cloud (Lambda, Cloud Functions, etc) • only pay while the function is running (charged per GBsec) • your platform scales on demand @lornajane
application (focussed API, microservices) • For occasional server needs (contact form on static site) • To provide compute power (processing quantities of data) • To move heavy lifting off web platform (classic example: PDF generation) @lornajane
with locations and dates. Use a serverless platform (IBM Cloud Functions) and PostgreSQL GET /plans list all plans GET /plans/42 show one plan POST /plans create a new plan DELETE /plans/42 delete a plan @lornajane
Run on-demand in response to an event • Incoming parameters can include • event information • parameters set at deploy time • connection info for other services @lornajane
let us: • group actions together • add parameters to a package that will be available to all actions From the deployment script, the line to create plans-api: ibmcloud wsk package update plans-api @lornajane
• create package.json and run npm install • zip up index.js and node_modules into a zip file • deploy the zip file, and include runtime instructions cd write-plan zip -rq write-plan.zip index.js node_modules @lornajane
our HTTP request, set up the API Gateway: • create the API • set up the path, verb and action to link together ibmcloud wsk api create /plans GET plans-api/get-plans \ --response-type http @lornajane
downloads ibmcloud tool and cloud-functions plugin • set an API key as an environment variable • then run commands (see deploy.sh in GitHub project) @lornajane
expose endpoints • they share reusable components • specific components guard access to services/datastores • each component can be separately developed, tested and deployed @lornajane