From 146512f75e308691d3db1475e6a11ef4080bb549 Mon Sep 17 00:00:00 2001 From: XadillaX Date: Mon, 30 Oct 2017 16:04:05 +0800 Subject: [PATCH 1/2] akyuu: move `init()` to constructor Fixes: https://github.com/akyuujs/akyuu/issues/37 PR-URL: https://github.com/akyuujs/akyuu/pull/38 Reviewd-By: DuanPengfei --- example/demo/src/app.js | 5 ++++- lib/akyuu.js | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) 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(); From 6c5c5aac87156f0a0309c4a5445c4dcc71f2a5c4 Mon Sep 17 00:00:00 2001 From: DuanPengfei <2459714173@qq.com> Date: Fri, 2 Mar 2018 11:35:31 +0800 Subject: [PATCH 2/2] 2018-03-02, Version 0.5.1 Notable changes * **Core** * Fix can't set template root and engine before `init()`. PR-URL: #38 --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4df2a3..cac8bd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ +0.5.1
0.5.0
0.4.0
0.3.0
@@ -13,6 +14,19 @@ + +## 2018-03-02, Version 0.5.1 (Current), @DuanPengfei + +### Notable changes + +* **Core** + * Fix can't set template root and engine before `init()`. + +### Commits + +* [[`146512f75e`]](https://github.com/akyuujs/akyuu/commit/146512f75e308691d3db1475e6a11ef4080bb549) - akyuu: move `init()` to constructor (@XadillaX) [#38](https://github.com/akyuujs/akyuu/pull/38) + + ## 2017-10-23, Version 0.5.0 (Current), @DuanPengfei