Developing SDK apps on c9.io

Cloud9 is an absolutely genius web-based IDE: https://c9.io - and it turns out to be a great dev environment for domo apps. The key is to make one small change to the server.js file after installing the CLI (I'm hoping this becomes a configurable option in a future release).

 

Sign up, create a new workspace:

  • Workspace Name: whatever
  • Clone from Git: leave blank, unless if you're cloning from an existing app repo
  • Choose a template: Blank (with the Ubuntu logo)

That'll build a docker VM and drop you in the IDE window within about a minute. In the Terminal window, run:

 

nvm install 7.2.0
nvm alias default 7.2.0

I'm using NodeJS v7.2.0 as of today, but so long as you're running the version supported by the latest SDK release you'll be OK. The alias command forces the system to use the specified version as the default - without it you'd need to `nvm switch 7.2.0` every time you opened a terminal.

 

Then install the SDK:

 

npm install -g ryuu

When that's done, we need to make a small edit. Find the domo executable:

 

which domo

Screen Shot 2016-12-21 at 11.44.08 AM.png

 

Edit the server.js file:

 

nano /home/ubuntu/.nvm/versions/node/v7.2.0/lib/node_modules/ryuu/server/server.js

On line 26, change basePort to 8080:

 

portfinder.basePort = 8080;

Save (Ctrl+O) and exit (Ctrl+X), then proceed normally:

 

cd ~/workspace
domo init
cd myapp
domo login
domo dev --external

The external switch is necessary, apparently, to let external connections into your app - c9.io uses a reverse proxy that maps :8080 in your VM, to :80/:443 on the outside. Click Preview > Preview Running Application in the top menu bar to bring up a browser window.

 

Screen Shot 2016-12-21 at 11.48.39 AM.png

From here you can do all the cool stuff c9 lets you do - like share your workspace with colleagues, code collaboratively, share your app publically, whatever you need.

---
Technical Consultant @ Acceleration
This discussion has been closed.