fix(root) pathToWin only when root dir

fix(route) fullPath -> name
This commit is contained in:
coderaiser 2015-04-07 05:22:52 -04:00
parent 0c76d2dbdf
commit 29beabb114
2 changed files with 5 additions and 3 deletions

View file

@ -11,7 +11,9 @@
if (root === '/')
dir = mellow.pathToWin(dir);
else
dir = path.join(root + dir);
return path.join(root + dir);
return dir;
};
})();

View file

@ -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) {