throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))
^
TypeError: Router.use() requires a middleware function but got a Object
at Function.use (/Users/zhangjie/myProjects/blog-manage/node_modules/express/lib/router/index.js:458:13)
at Function.<anonymous> (/Users/zhangjie/myProjects/blog-manage/node_modules/express/lib/application.js:220:21)
at Array.forEach (<anonymous>)
at Function.use (/Users/zhangjie/myProjects/blog-manage/node_modules/express/lib/application.js:217:7)
at module.exports (/Users/zhangjie/myProjects/blog-manage/server/controler/index.js:7:7)
at Object.<anonymous> (/Users/zhangjie/myProjects/blog-manage/server/index.js:25:1)
at Module._compile (module.js:641:30)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
在编写接口时,因为未将router通过 module.export
导出, 导致出现上面的错误
网友评论