UNPKG

aliez-post

Version:

aliez server post pre-handle midware

29 lines (20 loc) 500 B
# aliez-post aliez 服务器post方法预处理,接收post内容并解析为对象 ## 安装 ``` npm install aliez-post ``` ## 使用 ```javascript var aliez = require('aliez'); var aliez_post = require('aliez-post'); aliez.createServer() .use(aliez_post) .post('/', function(req, res){ // 假设post过来的内容为id=1&name=666 // POST对象 console.log(req.POST); // {id: 1, name: 666} // 未处理的字符串 console.log(req.RAW_POST); // id=1&name=666 }).listen(8080); ```