https://github.com/mangotsing/koa2-mysql
根据教程 [Node+Koa2+Mysql 搭建简易博客]改写简易blog
https://github.com/mangotsing/koa2-mysql
Last synced: 5 months ago
JSON representation
根据教程 [Node+Koa2+Mysql 搭建简易博客]改写简易blog
- Host: GitHub
- URL: https://github.com/mangotsing/koa2-mysql
- Owner: MangoTsing
- Created: 2018-03-08T14:42:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-13T12:56:45.000Z (about 8 years ago)
- Last Synced: 2025-06-14T14:45:08.011Z (about 1 year ago)
- Language: HTML
- Homepage:
- Size: 192 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README(wclimb-Koa2-blog).md
Awesome Lists containing this project
README
# Koa2-blog
node+koa2+mysql (欢迎star)
> 现在最新的代码有变动,请参照最新的代码,新增了上传头像、分页、markdown语法等
教程 [Node+Koa2+Mysql 搭建简易博客](http://www.wclimb.site/2017/07/12/Node-Koa2-Mysql-%E6%90%AD%E5%BB%BA%E7%AE%80%E6%98%93%E5%8D%9A%E5%AE%A2/)
### 创建数据库
登录数据库
```
$ mysql -u root -p
```
创建数据库
```
$ create database nodesql;
```
使用创建的数据库
```
$ use nodesql;
```
> database: nodesql tables: users posts comment (已经在lib/mysql建表)
| users | posts | comment |
| :----: | :----: | :----: |
| id | id | id |
| name | name | name |
| pass | title | content |
| avator | content | moment |
| moment | md | postid |
| - | uid | avator |
| - | moment | - |
| - | comments | - |
| - | pv | - |
| - | avator | - |
* id主键递增
* name: 用户名
* pass:密码
* avator:头像
* title:文章标题
* content:文章内容和评论
* md:markdown语法
* uid:发表文章的用户id
* moment:创建时间
* comments:文章评论数
* pv:文章浏览数
* postid:文章id
```
$ git clone https://github.com/wclimb/Koa2-blog.git
```
```
$ cd Koa2-blog
```
```
$ cnpm i supervisor -g
```
```
$ cnpm i
```
```
$ npm run dev(运行项目)
```
```
$ npm test(测试项目)
```
### 演示

### 注册

### 登陆

### 发表文章

### 文章详情

### 文章列表

### 个人文章页以及正常编辑删除文章和评论