import { Engine , engineSymbolKey } from './baseEngine' ; import * as Router from 'koa-router' ; export default class KoaEngine extends Engine { constructor ( router , dir , prefix = '' ) { super ( ) ; if ( ! router ) { router = new Router ( ) ; } this . router = router ; this . dir = dir ; this . prefix = prefix ; Reflect . defineMetadata ( engineSymbolKey , 'koaEngine' , Engine . prototype ) ; } controller ( ) { super . controller ( ) ; return this . router . routes ( ) ; } }