Skip to content

Commit

Permalink
rm hook
Browse files Browse the repository at this point in the history
  • Loading branch information
王志成 committed Oct 14, 2016
1 parent d3a5100 commit 4d0c399
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
10 changes: 0 additions & 10 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,12 @@
let app = require('koa')()
let path = require('path')
let static_cache = require('koa-static-cache')
let body = require('koa-body')
let config = require('./config')

// 处理post参数(this.request.body)
app.use(body({formidable:{uploadDir: __dirname}}));
// web-hooks
app.use(function *(next){
if(this.request.method=="POST" && this.path=="/web_hooks"){
console.log(this.request.body);
this.body = "OK"
return;
}
});
// 默认路径
app.use(function *(next){
console.log(this.request.method=="POST");
if(this.path=="/")
this.path = config.index
yield next;
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"dependencies": {
"koa": "^1.2.0",
"koa-static-cache": "3.1.7",
"koa-body": "1.5.0",
"nodemon": "1.11.0"
},
"scripts": {
Expand Down

0 comments on commit 4d0c399

Please sign in to comment.