Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Makes PUT /env support /env/<appname> syntax

  • Loading branch information...
commit b762252b9b6b60b82eb9366a73d6b62476135ee8 1 parent 75cbc48
@Tenzer Tenzer authored
Showing with 7 additions and 2 deletions.
  1. +1 −0  app.js
  2. +4 −0 lib/app.js
  3. +2 −2 public/api.html
View
1  app.js
@@ -326,6 +326,7 @@ app.get('/env/version', _app_.env_version);
*/
app.get('/env/version/:version', _app_.check_env_version);
app.get('/env/:appname', auth, authApp, _app_.env_get);
+app.put('/env/:appname', auth, authApp, _app_.env_put);
app.put('/env', auth, authApp, _app_.env_put);
app.del('/env/:appname/:key', auth, authApp, _app_.env_delete);
View
4 lib/app.js
@@ -687,6 +687,10 @@ Controller.env_put= function (req, res, next) {
, key = req.body.key
, value = req.body.value;
+ if (!appname){
+ appname = req.appname.toLowerCase();
+ }
+
if (!key || !value) {
res.json({
status: "failure",
View
4 public/api.html
@@ -351,8 +351,8 @@
<tr>
<td>&nbsp;</td>
<td><a class="btn disabled">PUT</a></td>
- <td><b>/env</b> - Create/update environment key/value pair (requires basic auth, appname, and environment key and value)<br />
- <code>curl -X PUT -u "testuser:123" -d "appname=a&key=color&value=blue" http://api.nodester.com/env</code>
+ <td><b>/env</b> - Create/update environment key/value pair (requires basic auth and environment key and value)<br />
+ <code>curl -X PUT -u "testuser:123" -d "key=color&amp;value=blue" http://api.nodester.com/env/&lt;appname&gt;</code>
</td>
</tr>
<tr>
Please sign in to comment.
Something went wrong with that request. Please try again.