From 142daeb924e16a35289d2b0a5b667182f279b01c Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 7 Apr 2015 04:15:08 -0400 Subject: [PATCH] feature(package) restafary v1.2.0 --- lib/cloudcmd.js | 3 ++- lib/server/route.js | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/cloudcmd.js b/lib/cloudcmd.js index 84cf72eb..36759c8b 100644 --- a/lib/cloudcmd.js +++ b/lib/cloudcmd.js @@ -89,7 +89,8 @@ authFunc, config(), restafary({ - prefix: cloudfunc.apiURL + '/fs' + prefix : cloudfunc.apiURL + '/fs', + root : config('root') || '/' }), rest, route, diff --git a/lib/server/route.js b/lib/server/route.js index 8c3183cf..7ff5c7b1 100644 --- a/lib/server/route.js +++ b/lib/server/route.js @@ -158,12 +158,12 @@ p.name = DIR_HTML + name + '.html'; ponse.sendFile(p); } else if (isFS) { - name = name.replace(CloudFunc.FS, '') || '/'; + fullPath = name.replace(CloudFunc.FS, '') || '/'; fullPath = root(name); mellow.read(fullPath, function(error, dir) { if (dir) - dir.path = format.addSlashToEnd(name); + dir.path = format.addSlashToEnd(fullPath); if (!error) buildIndex(dir, function(error, data) { diff --git a/package.json b/package.json index b51c9d40..e2e1647c 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "pipe-io": "~1.1.1", "ponse": "~1.3.0", "rendy": "~1.0.2", - "restafary": "~1.1.0", + "restafary": "~1.2.0", "socket.io": "~1.3.5", "tryrequire": "~1.1.5" },