Skip to content

Commit

Permalink
add web-hooks test
Browse files Browse the repository at this point in the history
  • Loading branch information
王志成 committed Oct 13, 2016
1 parent 8545789 commit fd2dd4d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@ let path = require('path')
let static_cache = require('koa-static-cache')
let config = require('./config')

// web-hooks
app.use(function *(next){
if(this.request.method=="POST"){
console.log(this.request);
this.body = "哦了"
return;
}
});
// 默认路径
app.use(function *(next){
console.log(this.request.method=="POST");
if(this.path=="/")
this.path = config.index
yield next;
Expand Down

0 comments on commit fd2dd4d

Please sign in to comment.