-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
103 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ addons: | |
|
||
services: | ||
- mongodb | ||
- redis-server | ||
|
||
before_install: | ||
- $CXX --version | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,21 +10,17 @@ | |
[coveralls-url]: https://coveralls.io/github/jackhutu/jackblog-api-koa?branch=master | ||
|
||
## 简介 | ||
Jackblog 是使用 Node.js + MongoDB + 其它客户端框架, 开发的个人博客系统,前后端分离,仿简书模板.此为服务端koa版. | ||
服务端有: | ||
[express版](https://github.com/jackhutu/jackblog-api-express) | ||
[koa版](https://github.com/jackhutu/jackblog-api-koa) | ||
客户端有: | ||
[angular1.x版](https://github.com/jackhutu/jackblog-angular1) | ||
[react redux 版](https://github.com/jackhutu/jackblog-react-redux) | ||
[vue 版](https://github.com/jackhutu/jackblog-vue) | ||
移动端有: | ||
[react native 版](https://github.com/jackhutu/jackblog-react-native-redux) | ||
Jackblog 是使用 Node.js + MongoDB + 其它客户端框架开发的个人博客系统,前后端分离,仿简书模板. | ||
服务端有: [express 版](https://github.com/jackhutu/jackblog-api-express) , [koa 版](https://github.com/jackhutu/jackblog-api-koa) | ||
客户端有: [angular1.x 版](https://github.com/jackhutu/jackblog-angular1) , [angular2.x 版](https://github.com/jackhutu/jackblog-angular2) , [react redux 版](https://github.com/jackhutu/jackblog-react-redux) , [vue 版](https://github.com/jackhutu/jackblog-vue) | ||
移动端有: [react native 版](https://github.com/jackhutu/jackblog-react-native-redux) | ||
##### 此为服务端koa版, 为客户端提供api. | ||
|
||
## 环境准备 | ||
``` | ||
node.js 4.0+ | ||
mognodb 3.0+ | ||
redis 2.8+ | ||
``` | ||
|
||
## 配置 | ||
|
@@ -42,14 +38,11 @@ mognodb 3.0+ | |
|
||
## 开发 | ||
``` | ||
$ git clone [email protected]:jackhutu/jackblog-api-koa.git | ||
$ cd jackblog-api-koa | ||
$ npm install | ||
$ gulp serve | ||
``` | ||
配合客户端测试的测试模式 | ||
|
||
``` | ||
$ gulp serve:test | ||
``` | ||
|
||
## 线上布署 | ||
``` | ||
|
@@ -61,6 +54,11 @@ $ pm2 start process.json | |
``` | ||
$ gulp test | ||
``` | ||
配合客户端测试的测试模式 | ||
|
||
``` | ||
$ gulp serve:test | ||
``` | ||
|
||
## License | ||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
const router = require("koa-router")(); | ||
const controller = require('./mobile.controller'); | ||
const router = require("koa-router")() | ||
const controller = require('./mobile.controller') | ||
|
||
router.get('/getApps',controller.getApps); | ||
router.get('/getApps',controller.getApps) | ||
|
||
module.exports = router; | ||
module.exports = router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
'use strict'; | ||
const config = require('../../config/env'); | ||
'use strict' | ||
|
||
const config = require('../../config/env') | ||
|
||
exports.getApps = function *(next){ | ||
if(config.apps){ | ||
this.status = 200; | ||
this.body = {success:true,data:config.apps}; | ||
this.status = 200 | ||
this.body = {success:true,data:config.apps} | ||
}else{ | ||
this.throw(404); | ||
this.throw(404) | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict' | ||
|
||
const _ = require('lodash') | ||
const Redis = require("ioredis") | ||
const config = require('../../config/env') | ||
const logger = require('../logs').logger | ||
|
||
const client = new Redis(config.redis) | ||
|
||
client.on("error", function (err) { | ||
logger.error('redis error', err) | ||
}) | ||
|
||
exports = module.exports = client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters