Skip to content

Commit

Permalink
akyuu: move init() to constructor
Browse files Browse the repository at this point in the history
Fixes: #37

PR-URL: #38
Reviewd-By: DuanPengfei <[email protected]>
  • Loading branch information
XadillaX authored and DuanPengfei committed Mar 2, 2018
1 parent f6b32c8 commit 146512f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion example/demo/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion lib/akyuu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 146512f

Please sign in to comment.