1 Star 2 Fork 0

Bright / egg

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
app.js 2.27 KB
一键复制 编辑 原始数据 按行查看 历史
Bright 提交于 2021-08-24 16:53 . 添加用户增删改查
const path = require('path');
// var Cache = require('js-cache');
class AppBootHook {
constructor(app) {
this.app = app;
}
// beforeStart() {
// this.app.runSchedule('backup_data');
// }
configWillLoad() {
this.app.loader.loadFile(path.join(this.app.config.baseDir, 'app/bootstrap/index.js'));
// const ctx = this.app.createAnonymousContext();
// this.app.nunjucks.addExtension('remote', new remote(ctx));
// this.app.nunjucks.addExtension('HeaderExtension', new HeaderExtension(ctx));
// this.app.nunjucks.addExtension('AssetsExtension', new AssetsExtension(ctx));
// this.app.nunjucks.addExtension('PluginsExtension', new PluginsExtension(ctx));
// this.app.nunjucks.addExtension('recommend', new recommend(ctx));
// this.app.nunjucks.addExtension('hot', new hot(ctx));
// this.app.nunjucks.addExtension('news', new news(ctx));
// this.app.nunjucks.addExtension('random', new random(ctx));
// this.app.nunjucks.addExtension('near_post', new near_post(ctx));
// this.app.nunjucks.addExtension('tags', new tags(ctx));
// this.app.nunjucks.addExtension('hottags', new hottags(ctx));
// this.app.nunjucks.addExtension('ads', new ads(ctx));
// this.app.nunjucks.addExtension('navtree', new navtree(ctx));
// this.app.nunjucks.addExtension('childnav', new childnav(ctx));
}
// async didLoad() {
// }
// async willReady() {
// // 请将你的应用项目中 app.beforeStart 中的代码置于此处。
// }
// async didReady() {
// let _theApp = this.app;
// _theApp.cache = new Cache();
// _theApp.messenger.on('refreshCache', by => {
// _theApp.logger.info('start update by %s', by);
// const ctx = _theApp.createAnonymousContext();
// ctx.runInBackground(async () => {
// let {
// key,
// value,
// time
// } = by;
// _theApp.cache.set(key, value, time);
// });
// });
// // 应用初始化
// let thisCtx = this.app.createAnonymousContext();
// this.app.init(thisCtx);
// }
}
module.exports = AppBootHook;
1
https://gitee.com/togoxl/egg.git
git@gitee.com:togoxl/egg.git
togoxl
egg
egg
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891