IBM/invoke-icf

Name: invoke-icf

Owner: International Business Machines

Description: invoke-icf

Created: 2018-03-27 14:12:39.0

Updated: 2018-03-27 14:32:52.0

Pushed: 2018-03-27 14:32:50.0

Homepage: null

Size: 8

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

invoke-icf

A short sample for invoking an action on the IBM Cloud Functions platform. Although there are plenty of samples on the web showing you how to invoke a microservice via the command line, invoking your microservices with an application isn't usually covered. This code fills that gap.

The code

The code consists of two files: service.js, the service previously deployed to ICF, and service-client.js, the point of this mailbag. To keep things simple, we invoke the service via the npm request module. The request module is one of the most popular npm modules, typically getting 25-30 million downloads a month. It's simple; easy to use; and, if you're a node developer, something you probably know already.

The developerWorks sandbox

The service was deployed to ICF via the developerWorks sandbox. The sandbox lets you run, modify, and re-run code without leaving the browser. Once you're happy with your modified code, you can click the Deploy button to deploy the code to ICF automatically. Once the code is deployed, anyone anywhere in the world can use the URL of your deployed code to invoke your microservice.

For more information

There are two developerWorks tutorials that cover this topic in far more detail:

The first article shows you how to invoke an ICF action via curl, a browser testing tool like Poster, from a node application, and from a Java application.

The second article explains how to write applications that can be deployed to ICF. It has embedded sandboxes inside the article, so you can write and deploy code without leaving the article.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.