微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

koahub-simple-cms 后台管理系统

程序名称:koahub-simple-cms

授权协议: MIT

操作系统: 跨平台

开发语言: JavaScript

koahub-simple-cms 介绍

koahub-simple-cms 是 koahub.js 简单的后台内容管理系统。

KoaHub.js:中文最佳实践 Node.js Web 快速开发框架。支持 Koa.js, Express.js 中间件。

//base controller, admin/controller/base.controller.js
module.exports = class extends koahub.controller {

    async _initialize() {
        console.log('base _initialize');
    }

    async isLogin() {
        console.log('base isLogin');
    }
}

//index controller, admin/controller/index.controller.js
const base = require('./base.controller');
module.exports = class extends base {

    async _initialize() {
        await super._initialize();
    }

    async index() {
        this.view(1);
    }

    async index2() {
        this.json(1, 2);
    }

    async index3() {
        await this.render('index');
    }
}

环境要求:Node.js >= 7.6.0

// 下载demo
git clone https://github.com/koahubjs/koahub-simple-cms.git
// 进入项目
cd koahub-simple-cms
// 安装依赖
npm install
// 创建koahub数据库
// 导入根目录下的koahub.sql
// 配置数据库连接config/db.config.js
// 启动项目
npm start
http://localhost:3000
// 后台账号密码 admin/admin

koahub-simple-cms 官网

http://git.oschina.net/koahubjs/koahub-simple-cms

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐