Skip to content

Commit

Permalink
fix: fix invoke loadController repeatedly
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 committed Nov 20, 2018
1 parent 4e6effd commit 8342649
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/midway-web/src/loader/webLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ export class MidwayWebLoader extends MidwayLoader {
router: Router
}> = [];

async loadController(opt?): Promise<void> {
async loadController(opt: { directory? } = {}): Promise<void> {
// load midway controller to binding router
const appDir = path.join(this.options.baseDir, 'app');
const results = loading(this.getFileExtension(['controllers/**/*', 'controller/**/*']), {
loadDirs: appDir,
loadDirs: opt.directory || appDir,
call: false,
});

Expand Down

0 comments on commit 8342649

Please sign in to comment.