Skip to content

Commit c96ee59

Browse files
author
Frand
committed
add readme
1 parent 5b1bb99 commit c96ee59

File tree

7 files changed

+65
-23
lines changed

7 files changed

+65
-23
lines changed

README.md

+57
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,59 @@
11
## NC-EXAMPLE
22
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)

config.js

-17
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,6 @@ let config = {
1717
mongodb: {
1818
db: 'mongodb://127.0.0.1/nc-example',
1919
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-
}
3720
}
3821
};
3922

public/css/_partial/content.less

+3-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@
7474
margin-bottom: 10px;
7575

7676
input{
77-
font-size: 20px;
77+
font-size: 16px;
78+
width: 300px;
79+
padding: 5px;
7880
}
7981
}
8082

public/css/_partial/sidebar.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
font-style: italic;
3131
}
3232

33-
span:nth-child(n+9){
33+
span:nth-child(n+10){
3434
color: #BBB;
3535
}
3636
}

public/css/style.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<% var topics = locals.topics || [] %>
33
<% topics.forEach(function(v){ %>
44
<div>
5-
<a href='/user/<%= v.author %>'><%= v.author %></a>
5+
<a href='/user/<%= v.author %>'>@<%= v.author %></a>
66
<a href='/topic/detail/<%= v._id %>'><%= v.title %></a>
77
<span><%= v.createAt %></span>
88
</div>

views/partial/sidebar.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</div>
55
<!-- 默认sidebar -->
66
<div class="introBox">
7-
<p>[NC-EXAMPLE]使用koa重新实现的一个简单nodeclub, 具体使用了如下技术点:</p>
7+
<p>[NC-EXAMPLE]精简版nodeclub, 技术点如下:</p>
88
<div class="fns">
99
<span>mongoose数据存储</span>
1010
<span>koa-router处理路由</span>
@@ -14,7 +14,7 @@
1414
<span>koa-request-log记录请求日志</span>
1515
<span>koa-session控制用户登录</span>
1616
<span>koa-compress启用gzip压缩</span>
17-
<span>koa-etag~添加缓存功能</span>
17+
<span>koa-etag/koa-conditional-get添加缓存功能</span>
1818
<span>mocha,chai单元测试</span>
1919
</div>
2020
</div>

0 commit comments

Comments
 (0)