Comparing version 0.1.2 to 0.1.3
var fileServer = require("./index"); | ||
var serverSettings = { | ||
"8787": { | ||
"basePath": "E:/baidu-svn/gcrm/src/main/webapp/front" | ||
"basePath": "./demo" | ||
}, | ||
"7676": { | ||
"basePath": "E:/baidu-svn/gcrm/src/main/webapp/front" | ||
"basePath": "./demo" | ||
} | ||
@@ -40,6 +40,6 @@ }; | ||
open: true, | ||
port: 9001 | ||
port: 9000 | ||
} | ||
}; | ||
fileServer.start(serverSettings, transRules, toolsConf); | ||
fileServer.start(serverSettings, transRules, toolsConf); |
@@ -12,3 +12,5 @@ var http = require("http"); | ||
var starWeinre = require('./tools/startWeinre.js'); | ||
var matchDirectory = require('./tools/matchDirectory.js'); // 增加匹配目录的功能 | ||
var dummyHelpers = { | ||
@@ -51,2 +53,3 @@ dateUTC: function (min, max, options) { | ||
realPath = path.join(servers[port].basePath, path.normalize(pathname.replace(/\.\./g, ""))); | ||
//匹配忽略列表,若匹配直接抛给回调函数 | ||
@@ -75,7 +78,7 @@ if (servers[port].ignoreRegExp && req.url.match(servers[port].ignoreRegExp)) { | ||
} | ||
} | ||
else { | ||
if (stats.isDirectory()) { | ||
realPath = path.join(realPath, "/", config.Welcome.file); | ||
pathHandle(realPath); | ||
matchDirectory(req, res, realPath); | ||
} | ||
@@ -289,2 +292,2 @@ else { | ||
return date; | ||
} | ||
} |
@@ -35,3 +35,3 @@ { | ||
"scripts": {}, | ||
"version": "0.1.2" | ||
"version": "0.1.3" | ||
} |
@@ -104,2 +104,11 @@ # gulp-bird | ||
node config.js | ||
``` | ||
``` | ||
### 如何开发和贡献代码 | ||
```sh | ||
npm install | ||
node app.js | ||
``` | ||
然后访问`localhost:7676`查看效果 |
@@ -114,2 +114,2 @@ var http = require("http"); | ||
}; | ||
}; | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29953
21
570
113
4