From 1b9bdd26a71b8b922adef8d6d1c863879a83b95a Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 24 Apr 2014 10:15:58 -0400 Subject: [PATCH] feature(rest) get: add config --- lib/client.js | 2 +- lib/server/rest.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/client.js b/lib/client.js index a0761960..cdcc07ee 100644 --- a/lib/client.js +++ b/lib/client.js @@ -307,7 +307,7 @@ var Util, DOM, CloudFunc; } this.setConfig = function(config) { Config = config; }; - this.getConfig = getSystemFile(Config, DIR_JSON + 'config.json'); + this.getConfig = getSystemFile(Config, '/api/v1/config'); this.getModules = getSystemFile(Modules, DIR_JSON + 'modules.json'); this.getExt = getSystemFile(Extensions, DIR_JSON + 'ext.json'); this.getFileTemplate = getSystemFile(FileTemplate, DIR_HTML_FS + 'file.html'); diff --git a/lib/server/rest.js b/lib/server/rest.js index 4153df08..55ce81e3 100644 --- a/lib/server/rest.js +++ b/lib/server/rest.js @@ -244,6 +244,15 @@ send(p); break; + case 'config': + main.sendFile({ + name : JSONDIR + 'config.json', + request : p.request, + response: p.response, + cache : false + }); + break; + default: json = Util.stringifyJSON({ error: 'command not found'