express中的路径区别
请求的url:http://localhost:3000/api/article/upload?q=1000&n=tom
请求方法:post
console.log('hostname==='+req.hostname); console.log('protocol==='+req.protocol); console.log('port==='+req.app.get('port')); console.log('originalUrl==='+req.originalUrl); console.log('baseUrl==='+req.baseUrl);//通过app.use挂载的路径 console.log('path==='+req.path); console.log('url==='+req.url); //打印结果 hostname===localhost protocol===http port===3000 originalUrl===/api/article/upload?q=1000&n=tom baseUrl===/api/article path===/upload url===/upload?q=1000&n=tom