Question

Okay, so wanting to start a little oss project via c9. I'd like to publish one config (private to nodester, containing for example mongolab credentials). I would rather not have this information in the example config that goes to github... how do others handle this?

Also, is this possible on a free c9 account?

Was it helpful?

Solution

I'd like to suggest you to read this article which tell you how to deploy from c9. In addition you can add environmental variables via our API explorer or via curl:

curl -X PUT -u "testuser:123" -d "appname=a&key=color&value=blue" http://api.nodester.com/env

So for example you want the MONGO_URL, you can do this:

(this is a one line command)

$ curl -XPUT -u "username:password" -d "appname=myappname&key=MONGO_URL&value=http://link.to/mongo/db" http://api.nodester.com/env

And then in your app:

var mongo = require('mongodriver');

var db = mongo.connect(MONGO_URL);

Hope this help.

OTHER TIPS

From within cloud9 I'd suggest using the command line arguments (in the run panel) to set sensitive config data. These are not visible to the outside world unless you grant someone write access.

You can depend on the presence of the environment variable C9_PROJECT to determine that you are in Cloud9.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top