middle ware for front-engineer to server
npm install node-interface
cd ./node-interface
sudo npm install
sh ./bin/start.sh n (n means how many ports will be listened(8030+n))
$.ajax({
url:'http://127.0.0.1:8031',
type:'post',
data:{
0:{
url:'http://url',
type:'get',
data:'uId=1'//use key=value&key=value, beacuse this is get method
},
1:{
url:'http://url',
type:'post',
data:{uId:1}//use object , because this is post method
}
},
success:function(data){
console.log(JSON.parse(data))//the data is an Array ,and it include [data[0],data[1]]
}
})
node-interface will help you to request data[0].url && data[1].url and merge the response return back to users
The success data has contained data[0]&data[1] result;
server client must has restful API status to ensure node can checkAPI status changes in ./app/deps/httpRequest line 34