Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added in environment variable setting and deleting. #9

Merged
merged 1 commit into from

2 participants

@mintplant

Would've added in getting as well, but the API kept 404'ing on me for that.

Relevant: nodester/nodester-cli#35

@mintplant

Just noticed the API docs got fixed; adding in GET support!

@nodester nodester merged commit 228511d into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 28, 2012
  1. @mintplant
This page is out of date. Refresh to see the latest.
Showing with 20 additions and 0 deletions.
  1. +16 −0 lib/nodester.js
  2. +4 −0 src/nodester.coffee
View
16 lib/nodester.js
@@ -196,6 +196,22 @@
return this.get("appdomains", cb);
};
+ Nodester.prototype.env_set = function(name, key, value, cb) {
+ return this.put("env", {
+ appname: name,
+ key: key,
+ value: value
+ }, cb);
+ };
+
+ Nodester.prototype.env_delete = function(name, key, cb) {
+ return this.del("env/" + (escape(name)) + "/" + (escape(key)), cb);
+ };
+
+ Nodester.prototype.env_get = function(name, cb) {
+ return this.get("env/" + (escape(name)), cb);
+ };
+
return Nodester;
})();
View
4 src/nodester.coffee
@@ -68,6 +68,10 @@ class Nodester
appdomain_delete: (name, domain, cb) -> @del "appdomains", {appname: name, domain: domain}, cb
appdomains: (cb) -> @get "appdomains", cb
+
+ env_set: (name, key, value, cb) -> @put "env", {appname: name, key: key, value: value}, cb
+ env_delete: (name, key, cb) -> @del "env/#{escape(name)}/#{escape(key)}", cb
+ env_get: (name, cb) -> @get "env/#{escape(name)}", cb
handleResponse = (cb) ->
return (err, res, body) =>
Something went wrong with that request. Please try again.