Skip to content

Commit efc0583

Browse files
committed
[updated] 注释,移除不必要中间件
1 parent 6d1dd79 commit efc0583

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/app.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const logger = require('./log');
1010
//Middlewares
1111
const staticFile = require('./middleware/static');
1212
const bodyParser = require('./middleware/bodyparser');
13-
const validate = require('./middleware/bodyparser');
1413
const body = require('./middleware/bodyparser');
1514
const view = require('./middleware/view');
1615
const requestLogger = require('./middleware/log/requestLogger');
@@ -25,6 +24,15 @@ const log = logger.createLogger('app');
2524
* @class Application
2625
*/
2726
class Application {
27+
/**
28+
* @param {String} options.cwd 工作目录
29+
* @param {String} options.routes 路由表配置
30+
* @param {String} options.controller 控制器目录
31+
* @param {String} options.view 视图目录
32+
* @param {String} options.staticFile 静态文件根目录
33+
* @param {Array<String>} options.middlewares 中间件名称集合
34+
* @param {String} options.middlewarePath 中间件目录
35+
*/
2836
constructor(options) {
2937
const app = this._app = new Koa();
3038
let opt = this._opt = defaults(options, {
@@ -77,7 +85,7 @@ class Application {
7785
mw && app.use(mw(mwOptions));
7886
});
7987

80-
app.use(controller(opt))
88+
app.use(controller(opt));
8189
}
8290
start(port = 5000) {
8391
return new Promise((resolve, reject) => {

0 commit comments

Comments
 (0)