API Builder Development with Cloud9 – Part 2

In part 1 of this blog series, we discussed the basic concept and benefits of developing API Builder projects using Cloud9, namely:

  • Develop in the cloud from any computer with a browser
  • Collaborate with other developers
  • Built-in IDE, terminal, file manager, …
  • Your API Builder APIs are easily accessible by web sites or mobile apps even during development
  • Manage node/npm/nvm versions without conflicting with your personal or work computer versions
  • Support for MongoDB and MySQL

As a reminder, the developer experience is illustrated in the screen shots below. In the first browser tab, I can see my Cloud9 API Builder developer environment which is used to set up my project and install connectors, etc.

In the second browser tab, I can develop my API Builder project in the API Builder Console:

In this blog post, we will cover the following additional topics:

  • Upgrading Cloud9’s node version for API Builder 3.0
  • How to enable and access the API Builder Console
  • How to upload and download files between Cloud9 and your local machine
  • How to install, configure and use MongoDB on Cloud9 and configure the API Builder MongoDB connector to access it

Upgrade Cloud9’s Node Version for API Builder 3.0

API Builder 3.0 was released in December 2017. You can read about it in the online release notes. Besides adding great new features, such as API-First APIs, Graphical Flow Editor for API Orchestrations, API Mocking, a Flow SDK and 20 new connectors, a major change is that the minimum required node version increased to 8.0.0.

As of the writing of this blog post, Cloud9’s default node environment is less than 8.0.0, which means we need to upgrade node. Here is one way you can achieve this:

  • Install a node version using command line:
    nvm install 9.2.1

    NOTE: Make sure the node version meets the minimum and maximum versions required by API Builder. At the time of the writing of this blog post, 9.2.1 was the latest node version.

  • List node versions installed
    nvm ls
  • Select node version
    nvm use v9.2.1
  • Set node version as default
    nvm alias default 9.2.1

Now, every time your start your Cloud9 API Builder environment, the correct node version will be used.

Enable and Access the API Builder Admin Console

Another recent change in API Builder is the ability to restrict what IP addresses or hostnames can access the API Builder Console, which is the browser interface for developing your APIs. This is done in the /conf/default.js file in your project folder.

The default is:

allowedHosts: [
	'localhost', '::1'

I typically make it empty as follows:

allowedHosts: [

Upload and Download Files Between Cloud9 and Your Local Machine

You may want to download files from Cloud9 to your local machine, say, for example to download your API Builder project for backup.

To do that, you click on the file or folder you want to download and right click and select download as follows:

The files will be downloaded to your local machine’s browser download folder.

Also, you may need to upload files from your local machine to Cloud9, say, to upload a project folder.

To do that, you click on the folder that you want to upload to and then click on the file menu and select Upload Local Files as follows:

Install, Configure and Use MongoDB on Cloud9

The Cloud9 Community web site has a great guide for installing MongoDB in your Cloud9 instance.

After following the instructions in the guide, you can run the MongoDB Daemon (mongod) in the Cloud9 terminal and look at the log output and look for the host name:

In my example, above, the host is lbrenman-arrowclouddev-5763242. This will be used to configure the API Builder MongoDB connector url.

In my MongoDB, I created a database called test with a collection called employees. I did this from the command line in the Cloud9 terminal.

In your API Builder project, install the MongoDB connector as described in the Axway AMPLIFY Marketplace:

appc install connector/appc.mongo

Edit the MongoDB connector configuration file in the /conf folder. Basically, we need to configure the url to the url of our MongoDB database as follows:

module.exports = {
  connectors: {
    'appc.mongo': {
      url: 'mongodb://lbrenman-arrowclouddev-5763242:27017/test',

      // Create models based on the schema that can be used in your API.
      generateModelsFromSchema: true,

      // Whether or not to generate APIs based on the methods in generated models.
      modelAutogen: true

The url is composed of:

  • The prefix mongodb://
  • The host name: lbrenman-arrowclouddev-5763242

Replace with your host name

  • The database name: test

Replace with your database name

Now, you can run your project (appc run) and use the admin console to view your models (MongoDB collections) and create and test APIs as follows: