CDC 1 Cognitive Lab
CDC 1 Cognitive Lab
Prerequisites
IBM Bluemix account. Consider subscribing to developerWorks Premium
A web browser supported by Bluemix:
o Chrome: the latest version for your operating system
o Firefox: the latest version for your operating system and ESR 38
o Internet Explorer: version 11
o Safari: the latest version for the Mac
Cloud Foundry command line interface, version 6.5.1 or later; it’s recommended that you
use the latest release
Git Bash and Git GUI
Node.js
1. Open the Git UI and create a new repository. Enter a name for the new repository and
click Create.
5. You can get a key for Alchemy API through your Bluemix account. Log in to
http://bluemix.net and click on Catalog and type Alchemy in the search bar
6. Click on the AlchemyAPI item to bring up the instance creation panel. Leave the service
unbound and click on Create.
3 Copyright IBM Corporation 2013-2016. All rights reserved.
Lab: Using AlchemyAPI
7. Once the service is created you will see the service control panel. Click on Service
Credentials and then click on the View Credentials pulldown to see your API key. It will
be different than the one shown.
8. Copy the key and run the alchemyapi.js code to enter your API key to configure the
application:
You should see a message saying that you are ready to use AlchemyAPI.
10. Open a browser to http://localhost:3000 to see the results, which should look like this:
11. The Cloud Foundry CLI tool (cf) is not supported on git bash for Windows. To see the
application running in Bluemix, open a command prompt and change to your Alchemy
folder. Then, change to the alchemyapi_node directory.
12. Set the API to point to IBM Bluemix by using the command cf login -a
https://api.ng.bluemix.net (replacing with your preferred Bluemix region API
endpoint if desired). Then, log in with your IBM ID and password and choose the desired
organization and space for the application.
13. Push this app to Bluemix by using the command cf push application_name. To
avoid a conflicting route, append your initials and the month and year to
alchemyapi_getting_started for application_name.
15. To make changes in the app, change to the files in the folder on your local machine and
save your changes. Use the cf push command to push the app again to Bluemix.