-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
22 lines (20 loc) · 761 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var express = require('express');
var request = require('request');
var app = express();
app.get('/',function(req,res){
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Content-Type,Content-Length, Authorization, Accept,X-Requested-With");
res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
var type = req.query.type;
var id =req.query.postid;
console.log('type:',type,'id:',id)
var url = "http://www.kuaidi100.com/query?type="+type+"&postid="+id+"&temp=0.2667807781744884";
console.log(url)
request(url,function(err,response,body){
if(err){
return console.log(err)
}
res.send(response.body)
});
});
app.listen('5000');