File tree 7 files changed +65
-23
lines changed
7 files changed +65
-23
lines changed Original file line number Diff line number Diff line change 1
1
## NC-EXAMPLE
2
2
an simple nodeclub example project realize by koa
3
+
4
+ ## startup
5
+
6
+ 1 . clone本项目
7
+ 2 . 准备项目环境
8
+
9
+ - `node v4.3.0`
10
+ - `mongodb v3.0.7`
11
+
12
+ 3 . 修改项目根目录下配置文件` config.js `
13
+ 4 . 安装项目依赖
14
+
15
+ - `$npm install`
16
+
17
+ 5 . 启动项目
18
+
19
+ - `$node app`
20
+
21
+ ## feature
22
+
23
+ 项目特性列表如下:
24
+
25
+ - mongoose数据存储
26
+ - koa-ejs页面渲染
27
+ - koa-router处理路由
28
+ - koa-session控制用户登录
29
+ - koa-send控制静态文件访问
30
+ - koa-compress启用gzip压缩
31
+ - koa-request-log记录请求日志
32
+ - koa-less使用less编译样式文件
33
+ - koa-etag/koa-conditional-get添加缓存功能
34
+
35
+ ## showing
36
+
37
+ - 首页
38
+
39
+ [ 首页] ( http://www.startexample.com/images/assist/20160417/index.png )
40
+
41
+ - 主题详情
42
+
43
+ [ 主题详情] ( http://www.startexample.com/images/assist/20160417/topicDetail.png )
44
+
45
+ - 主题发表
46
+
47
+ [ 主题发表] ( http://www.startexample.com/images/assist/20160417/publishTopic.png )
48
+
49
+ - 主题回复
50
+
51
+ [ 主题回复] ( http://www.startexample.com/images/assist/20160417/reply.png )
52
+
53
+ - 用户登录
54
+
55
+ [ 用户登录] ( http://www.startexample.com/images/assist/20160417/login.png )
56
+
57
+ - 用户注册
58
+
59
+ [ 用户注册] ( http://www.startexample.com/images/assist/20160417/registry.png )
Original file line number Diff line number Diff line change @@ -17,23 +17,6 @@ let config = {
17
17
mongodb : {
18
18
db : 'mongodb://127.0.0.1/nc-example' ,
19
19
poolSize : 5
20
- } ,
21
-
22
- // mysql 配置, 当前未使用
23
- mysql : {
24
- auth : {
25
- user : 'username' ,
26
- pass : 'password'
27
- } ,
28
- conn : {
29
- host : '127.0.0.1' ,
30
- dialect : 'mysql' ,
31
- pool : {
32
- max : 5 ,
33
- min : 0 ,
34
- idle : 10000
35
- }
36
- }
37
20
}
38
21
} ;
39
22
Original file line number Diff line number Diff line change 74
74
margin-bottom : 10px ;
75
75
76
76
input {
77
- font-size : 20px ;
77
+ font-size : 16px ;
78
+ width : 300px ;
79
+ padding : 5px ;
78
80
}
79
81
}
80
82
Original file line number Diff line number Diff line change 30
30
font-style : italic ;
31
31
}
32
32
33
- span :nth- child(n+ 9 ){
33
+ span :nth- child(n+ 10 ){
34
34
color : #BBB ;
35
35
}
36
36
}
Original file line number Diff line number Diff line change 2
2
< % var topics = locals.topics || [] %>
3
3
< % topics.forEach(function(v){ %>
4
4
< div >
5
- < a href ='/user/<%= v.author %> '> < %= v.author %> </ a >
5
+ < a href ='/user/<%= v.author %> '> @ < %= v.author %> </ a >
6
6
< a href ='/topic/detail/<%= v._id %> '> < %= v.title %> </ a >
7
7
< span > < %= v.createAt %> </ span >
8
8
</ div >
Original file line number Diff line number Diff line change 4
4
</ div >
5
5
<!-- 默认sidebar -->
6
6
< div class ="introBox ">
7
- < p > [NC-EXAMPLE]使用koa重新实现的一个简单nodeclub, 具体使用了如下技术点 :</ p >
7
+ < p > [NC-EXAMPLE]精简版nodeclub, 技术点如下 :</ p >
8
8
< div class ="fns ">
9
9
< span > mongoose数据存储</ span >
10
10
< span > koa-router处理路由</ span >
14
14
< span > koa-request-log记录请求日志</ span >
15
15
< span > koa-session控制用户登录</ span >
16
16
< span > koa-compress启用gzip压缩</ span >
17
- < span > koa-etag~添加缓存功能 </ span >
17
+ < span > koa-etag/koa-conditional-get添加缓存功能 </ span >
18
18
< span > mocha,chai单元测试</ span >
19
19
</ div >
20
20
</ div >
You can’t perform that action at this time.
0 commit comments