November 16, 2016 | Written by: Brian White Eagle
Categorized: How-tos | Mobile | Trending
Share this post:
Disclaimer: IBM Cloud Tools for Swift (ICT) is no longer supported. Check out IBM Cloud App Service to take advantage of the same features of ICT in a more comprehensive experience for building Cloud Native applications in any programming language.
IBM Cloud Tools for Swift (ICT) makes it easy for developers on macOS to deploy, manage, and monitor end-to-end applications on Bluemix. The tool is part of a larger IBM initiative to bring Swift to the server. This article highlights a new video we’ve recorded with the value ICT provides using a microservice use case. It demonstrates the value of ICT when combining microservices.
This demo video shows you how to get started with a Swift todo list sample, run it locally on your Mac, then run it remotely on Bluemix. In this video, we’ve extended that demo to communicate with an existing Node.js runtime, which interfaces with the Weather Company Data API on Bluemix.
To help you visualize how the demo works, here is a depiction of the architecture.
- We first show you how to run a todo list sample that uses a Local Kitura Web Server. Then we push it to a Cloudant Database on Bluemix and demonstrate the iOS client connecting to the Remote Kitura Web Server and the Cloudant Database.
- Next, we deploy an existing Node.js runtime that connects to data from the Weather Company API.
- Using Xcode 8, we modify the todo list sample app to query the Node.js app when the user inputs “Get current weather”. When the logic on Kitura sees this string, it queries The Weather Company Data and replaces the todo with the current weather in Austin, Texas.
- We test the connection locally, then deploy and test on Bluemix.
In the demo, first we get the todo list sample. This is deployed to Bluemix. We then show the iOS client connecting to the logic running on Kitura and storing data in a Cloudant Database.
Next, we get and deploy a “legacy” runtime which is running on Node.js. This logic provides the interface to data we query from the Weather Company Data API in Bluemix. This step uses the advanced ICT feature, “Create Sample Project from GitHub Repo.”
Then, we modify the Kitura app to query the legacy interface when the user inputs a special string for the todo, “Get current weather.” This is simply for demonstration purposes. When the logic on Kitura sees this string, it queries Weather Company Data and replaces the todo with the current weather in Austin, Texas.
Finally, we test that Kitura app running locally on macOS. When it is successful, we deploy and test it on Bluemix!
Try IBM Cloud Tools for Swift
If you are running macOS, you can download and install the app and deploy the same samples quickly. Check out the video below, try it out, and then let us know what you think!