UNPKG

mm_os

Version:

MM_OS服务端架构,用于快速构建应用程序,支持网站建设、小程序后台、AI应用、物联网(IOT/AIOT)、游戏服务端等多种场景。

52 lines 960 B
/** * 应用 */ module.exports = { /** * 安装 */ async _install() { this.log('info', `应用安装`); }, /** * 卸载 */ async _uninstall() { this.log('info', `应用卸载`); }, /** * 初始化 * @param {object} server 服务器对象 * @param {object} eventer 事件总线 */ async _init(server, eventer) { // this.log('debug', `初始化!`); }, /** * 启动 */ async _start() { // this.log('debug', `启动!`); }, /** * 停止 */ async _stop() { this.log('debug', `停止!`); }, /** * 销毁 * @param {...any} args 销毁参数 */ async _destroy(...args) { this.log('debug', `销毁!`, { args }); }, /** * 主要逻辑 * @param {...any} args 主逻辑参数 */ async main(...args) { this.log('debug', `主要逻辑被调用`, { args }); // 主要代码写在这 } };