错误:TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received an instance of IncomingMessage
原因:引用路由地址时一定要用module,exports=router结尾
跨域代码
app.use(function(req,res,next){
res.header('Access-Control-Allow-Origin' , ' *') ;
res.header('Access-Control-Allow-Headers' ,
' Content-Type,Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild');
res.header('Access-Control-Allow-Methods' , ' PUT, POST, GET, DELETE,OPTIONS') ; /