var
express = require(
'express'
);
var
bodyParser = require(
"body-parser"
);
var
app = express();
app.use(express.static(
'app'
));
app.use(bodyParser.urlencoded({ extended:
false
}));
var
server = app.listen(config.socket_port,
function
() {
var
host = server.address().address
var
port = server.address().port
console.log(
"应用实例,访问地址为 http://%s:%s"
, host, port)
})
var
post_callback =
function
(post_res, err, res){
return
post_res.end(JSON.stringify({err:err, res:res}));
}
app.post(
'/post'
,
function
(req, post_res) {
let data = req.body;
let filter = JSON.parse(data.filter);
return
post_callback(post_res,
null
, []);
});