diff --git a/lib/server/root.js b/lib/server/root.js index 8ae10076..a05aa3f4 100644 --- a/lib/server/root.js +++ b/lib/server/root.js @@ -11,7 +11,9 @@ if (root === '/') dir = mellow.pathToWin(dir); + else + dir = path.join(root + dir); - return path.join(root + dir); + return dir; }; })(); diff --git a/lib/server/route.js b/lib/server/route.js index 7ff5c7b1..8c3183cf 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) { - fullPath = name.replace(CloudFunc.FS, '') || '/'; + name = name.replace(CloudFunc.FS, '') || '/'; fullPath = root(name); mellow.read(fullPath, function(error, dir) { if (dir) - dir.path = format.addSlashToEnd(fullPath); + dir.path = format.addSlashToEnd(name); if (!error) buildIndex(dir, function(error, data) {