nodejs笔记

  • 获取客户端IP地址
req.headers['x-forwarded-for'] || req.connection.remoteAddress
  • 删除url中多余的/符号
req.url.replace(/(\/)\1+/g,'$1').replace(/^\/|\/$/g,'')
posted @ 2019-02-13 12:53  风的线条昵称已被使用  阅读(137)  评论(0编辑  收藏  举报