diff --git a/example/demo/src/app.js b/example/demo/src/app.js index 62bd075..2d89ee2 100644 --- a/example/demo/src/app.js +++ b/example/demo/src/app.js @@ -6,9 +6,12 @@ */ "use strict"; +const path = require("path"); + const akyuu = require("../../../"); -akyuu.init(err => { +akyuu.setTemplateRoot(path.resolve(__dirname, "templates")); +akyuu.init(function(err) { if(err) { console.error("Failed to start akyuu.js"); console.error(err.stack); diff --git a/lib/akyuu.js b/lib/akyuu.js index bb29617..c426510 100644 --- a/lib/akyuu.js +++ b/lib/akyuu.js @@ -47,11 +47,12 @@ class Akyuu extends Express { this.controller = new Controller(this); this.service = new Service(this); this.boot = new Boot(this); + + super.init(); } init(callback) { const self = this; - super.init(); // load logger this.logger.load();