UNPKG

astroboy

Version:

Astroboy(阿童木)is a Nodejs SFB(Separation of Front and Back ends) framework, built on koa2.

24 lines 608 B
"use strict"; const ContextView_1 = require("../lib/ContextView"); const VIEW = Symbol('Context#view'); const ctx = { get view() { if (!this[VIEW]) { this[VIEW] = new ContextView_1.ContextView(this); } return this[VIEW]; }, render(...args) { return this.renderView(...args).then((body) => { this.body = body; }); }, renderView(...args) { return this.view.render(...args); }, renderString(...args) { return this.view.render(...args); }, }; module.exports = ctx; //# sourceMappingURL=context.js.map