Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wunci/Koa2-blog
node+koa2+mysql
https://github.com/wunci/Koa2-blog
es6 koa2 koa2-blog mysql nodejs
Last synced: about 1 month ago
JSON representation
node+koa2+mysql
- Host: GitHub
- URL: https://github.com/wunci/Koa2-blog
- Owner: wunci
- Created: 2017-07-11T02:41:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-28T08:39:44.000Z (almost 2 years ago)
- Last Synced: 2024-11-05T07:34:15.075Z (about 1 month ago)
- Topics: es6, koa2, koa2-blog, mysql, nodejs
- Language: JavaScript
- Homepage:
- Size: 2.25 MB
- Stars: 897
- Watchers: 30
- Forks: 239
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-github-star - Koa2-blog
README
# Koa2-blog
node+koa2+mysql> 现在最新的代码有变动,请参照最新的代码,新增了上传头像、分页、markdown语法等
教程 [Node+Koa2+Mysql 搭建简易博客]
### 创建数据库
登录数据库
```
$ 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/wunci/Koa2-blog.git
```
```
$ cd Koa2-blog
```
```
$ cnpm i supervisor -g
```
```
$ cnpm i
```
```
$ npm run dev(运行项目)
```
```
$ npm test(测试项目)
```