学习搭建服务器可用postman 连接不了localhost的端口

 

 

网上好多教程是这样连接

postman连接不了localhost问题解决

看完视频后我们是这样

postman连接不了localhost问题解决

找了大量资料都解决不了,什么版本,什么证书的都不好使,最简单的就是去掉http://

postman连接不了localhost问题解决

 

 

//get 测试

const http=require('http')
const querystring=require('querystring')

const server=http.createServer((req, res)=>{
   
    //GET
    console.log('method',req.method)
    const url=req.url
    //  /
    console.log('url:',url)
    req.query=querystring.parse(url.split('?')[1])
    console.log('query:',req.query)

    res.end(
        JSON.stringify(req.query)
    )

})

server.listen(8000)
console.log('测试get')
node get

相关文章:

  • 2022-12-23
  • 2021-06-16
  • 2021-11-24
  • 2021-04-15
  • 2021-09-03
  • 2021-08-03
  • 2021-11-02
  • 2021-08-09
猜你喜欢
  • 2022-12-23
  • 2021-10-14
  • 2021-09-02
  • 2021-10-28
  • 2021-04-11
  • 2021-10-12
  • 2021-04-18
相关资源
相似解决方案