请到新页面查看新文档:https://me.i-i.me/article/78.html
jj.js

A simple and lightweight MVC framework built on nodejs+koa2(一个基于nodejs+koa2构建的简单轻量级MVC框架)
项目介绍
本框架依赖koa2、koa-router、art-template、mysql,基于proxy实现了代码自动加载及懒加载技术,最低运行依赖仅仅为koa和koa-router,非常轻量。
项目特性
- 系统架构模仿Thinkphp5,很容易上手
- 系统类库、用户类库都支持自动加载、懒加载、自动生成单实例
- 支持应用级、路由级、控制器级三级中间件,方便插件及二次开发
- 支持单应用和多应用两种运行模式
项目地址
项目地址:https://github.com/yafoo/jj.js
码云镜像:https://gitee.com/yafu/jj.js
官网地址:https://me.i-i.me/special/jj.html
安装
npm i jj.js
运行环境要求:node.js >= v12
Hello world !
1、创建控制器文件 ./app/controller/index.js
const {Controller} = require('jj.js');
class Index extends Controller
{
async index() {
this.$show('Hello jj.js, hello world !');
}
}
module.exports = Index;
2、创建应用入口文件 ./server.js
const {app, Logger} = require('jj.js');
app.run(3000, '127.0.0.1', function(err){
!err && Logger.info('http server is ready on 3000');
});
3、运行命令
node server.js
4、浏览器访问 http://127.0.0.1:3000,页面输出 Hello jj.js, hello world !
开发手册
https://me.i-i.me/article/78.html
关键词:jj.js
所属分类:jj.js
本文地址:https://me.i-i.me/article/54.html
评论