File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ const logger = require('./log');
10
10
//Middlewares
11
11
const staticFile = require ( './middleware/static' ) ;
12
12
const bodyParser = require ( './middleware/bodyparser' ) ;
13
- const validate = require ( './middleware/bodyparser' ) ;
14
13
const body = require ( './middleware/bodyparser' ) ;
15
14
const view = require ( './middleware/view' ) ;
16
15
const requestLogger = require ( './middleware/log/requestLogger' ) ;
@@ -25,6 +24,15 @@ const log = logger.createLogger('app');
25
24
* @class Application
26
25
*/
27
26
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
+ */
28
36
constructor ( options ) {
29
37
const app = this . _app = new Koa ( ) ;
30
38
let opt = this . _opt = defaults ( options , {
@@ -77,7 +85,7 @@ class Application {
77
85
mw && app . use ( mw ( mwOptions ) ) ;
78
86
} ) ;
79
87
80
- app . use ( controller ( opt ) )
88
+ app . use ( controller ( opt ) ) ;
81
89
}
82
90
start ( port = 5000 ) {
83
91
return new Promise ( ( resolve , reject ) => {
You can’t perform that action at this time.
0 commit comments