chanjs 1.0.29 → 1.0.30
Sign up to get free protection for your applications and to get access to all the features.
- package/README.en.md +100 -0
- package/README.md +2 -0
- package/package.json +3 -1
package/README.en.md
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
# [中文](./README.md) | English
|
2
|
+
|
3
|
+
# <center>Chan.js MVC Framework</center>
|
4
|
+
|
5
|
+
Chan.js is a lightweight MVC framework developed in pure JavaScript based on Express. It embodies functional programming concepts, offering superior performance, clear code, and easy-to-follow processes that ensure high maintainability.
|
6
|
+
|
7
|
+
## 特性
|
8
|
+
|
9
|
+
- Built on top of Express
|
10
|
+
- Supports ES6 syntax
|
11
|
+
- Modular Design
|
12
|
+
- Supports multiple module routes
|
13
|
+
- Supports multiple module views
|
14
|
+
- Supports multiple module controllers
|
15
|
+
- Supports multiple module services
|
16
|
+
- Plugin-based architecture
|
17
|
+
- Lightweight (core code within 300 lines)
|
18
|
+
- Long-term maintenance
|
19
|
+
|
20
|
+
## Conventions Over Configuration
|
21
|
+
|
22
|
+
```code
|
23
|
+
|- app
|
24
|
+
|- config 配置
|
25
|
+
|- module 模块1
|
26
|
+
|- module1 模块1
|
27
|
+
|- controller 控制器
|
28
|
+
|- service 服务模型
|
29
|
+
|- view 视图模板
|
30
|
+
|- router.js 路由
|
31
|
+
|- module2 模块2
|
32
|
+
|- controller 控制器
|
33
|
+
|- service 服务模型
|
34
|
+
|- view 视图模板
|
35
|
+
|- router.js路由
|
36
|
+
|- extend 扩展
|
37
|
+
|- middleware 中间件
|
38
|
+
|- plugin 插件
|
39
|
+
|- plus-module1 插件1
|
40
|
+
|- controller 控制器
|
41
|
+
|- service 服务模型
|
42
|
+
|- view 视图模板
|
43
|
+
|- router.js 路由
|
44
|
+
|- module2 插件2
|
45
|
+
|- controller 控制器
|
46
|
+
|- service 服务模型
|
47
|
+
|- view 视图模板
|
48
|
+
|- router.js路由
|
49
|
+
|- public 静态文件
|
50
|
+
|- index.js
|
51
|
+
```
|
52
|
+
|
53
|
+
### Initialization Process
|
54
|
+
|
55
|
+
- Initialization
|
56
|
+
- Load configuration
|
57
|
+
- Load modules
|
58
|
+
- Load services
|
59
|
+
- Load controllers
|
60
|
+
- Load routers
|
61
|
+
- Load extensions
|
62
|
+
- Load plugins
|
63
|
+
- Load services
|
64
|
+
- Load controllers
|
65
|
+
- Load routers
|
66
|
+
- beforeStart() Hook to merge configurations from the database into the configuration
|
67
|
+
- run() Start the server
|
68
|
+
|
69
|
+
### Official Website
|
70
|
+
|
71
|
+
A CMS system developed with Chan.js
|
72
|
+
Website:<https://www.chancms.top>
|
73
|
+
|
74
|
+
### Highlights
|
75
|
+
|
76
|
+
- Configuration files
|
77
|
+
- Multi-module MVC structure
|
78
|
+
- Plugin MVC support
|
79
|
+
- CORS cross-origin configuration support
|
80
|
+
- MySQL database support
|
81
|
+
- Route control
|
82
|
+
- Art-template template engine
|
83
|
+
- Static resources management
|
84
|
+
- Cookie handling
|
85
|
+
- Logging capabilities
|
86
|
+
|
87
|
+
### 运行
|
88
|
+
|
89
|
+
```javascript
|
90
|
+
const Chanjs = require("chanjs");
|
91
|
+
const chan = new Chanjs();
|
92
|
+
// Load middleware
|
93
|
+
chan.beforeStart(fn);
|
94
|
+
// Scan modules
|
95
|
+
chan.start();
|
96
|
+
// Start the server
|
97
|
+
chan.run();
|
98
|
+
```
|
99
|
+
|
100
|
+
This framework is designed for developers who seek a balance between simplicity and functionality, providing a robust foundation for building web applications with ease.
|
package/README.md
CHANGED
package/package.json
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"name": "chanjs",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.30",
|
4
4
|
"description": "chanjs基于express 纯js研发的轻量级mvc框架。",
|
5
5
|
"main": "core/chan.js",
|
6
6
|
"module": "core/chan.js",
|
7
7
|
"keywords": [
|
8
8
|
"\"chanjs\"",
|
9
9
|
"\"express mvc\"",
|
10
|
+
"\"express mysql\"",
|
11
|
+
"\"express knex\"",
|
10
12
|
"\"chancms\"",
|
11
13
|
"\"nodejs\""
|
12
14
|
],
|