From ab407b22bdcc20632e349684938d0ccfbb431cf9 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 8 Apr 2015 03:20:10 -0400 Subject: [PATCH] feature(root) rm path --- lib/server/root.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/server/root.js b/lib/server/root.js index 95f50d05..51c6fbe5 100644 --- a/lib/server/root.js +++ b/lib/server/root.js @@ -2,20 +2,13 @@ 'use strict'; var DIR = './', - path = require('path'), config = require(DIR + 'config'), mellow = require('mellow'); module.exports = function(dir) { var root = config('root') || '/'; - if (dir === '/') - dir = root; - else - if (root === '/') - dir = mellow.pathToWin(dir); - else - dir = path.join(root, dir); + dir = mellow.pathToWin(dir, root); return dir; };